Re: Might be doing this wrong? (Turtle graphics)
On Wednesday, March 20, 2019, at 7:34:53 PM UTC-4, CrazyVideoGamez wrote: > So, I typed in code: > from turtle import * > forward(100) > right(120) > clear() > It didn't work! It kept on saying that there was an indent and the first line > was wrong. Help! I'm a beginner by the way. -- https://mail.python.org/mailman/listinfo/python-list
What does "TypeError: unsupported operand type(s) for +: 'function' and 'int'" mean?
I have no idea what "TypeError: unsupported operand type(s) for +: 'function' and 'int'" means and I don't know how to fix it. Help! -- https://mail.python.org/mailman/listinfo/python-list
Re: What does "TypeError: unsupported operand type(s) for +: 'function' and 'int'" mean?
On Monday, March 25, 2019, at 3:31:09 PM UTC-4, CrazyVideoGamez wrote: > I have no idea what "TypeError: unsupported operand type(s) for +: 'function' > and 'int'" means and I don't know how to fix it. Help! -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 3.7 Bug
On Monday, March 25, 2019 at 2:07:11 PM UTC-4, Bassam Abdul-Baki wrote: > Greetings, > > In the following code, there's a bug on certain parameters. > > -- > > def per(n, steps = 0): > digits = [int(i) for i in str(n)] > result = 1 > for j in digits: > result *= j > steps += 1 > print(steps, result, sep=" - ") > if result == 0: > print(result, str(result), len(str(result)), sep=" - ") > if len(str(result)) == 1: > print(" --- DONE ---") > return "DONE" > else: > per(result, steps) > > -- > > What the program does: > If I run per(X) and X is a multiple of 10, I should end up with 0 in a > finite amount of steps. > > The problem: > If I run per(54), I do not get 'DONE' printed through the return > statement. WRONG! > > If I run per(20), I do get 'DONE' printed through the return statement. > CORRECT! > > 20, 30, etc. are correct. 25, 45, etc. are not. > > Is this a bug? > > Thanks, > Bassam I dunno -- https://mail.python.org/mailman/listinfo/python-list
Re: Might be doing this wrong? (Turtle graphics)
On Wednesday, March 20, 2019 at 8:29:42 PM UTC-4, MRAB wrote: > On 2019-03-21 00:12, DL Neil wrote: > > Jason, > > > > On 21/03/19 12:34 PM, jasonanyil...@gmail.com wrote: > >> So, I typed in code: > >> from turtle import * > >> forward(100) > >> right(120) > >> clear() > >> It didn't work! It kept on saying that there was an indent and the first > >> line was wrong. Help! > > > > > > It would be most helpful if you gave us the exact error msg, in the same > > way that you copy-pasted the source-code. > > > > "Turtle" is not part of the Python 'core'. It has to be added from the > > Python Standard Library (PSL). > > > > My !GUESS! is that the Turtle library is not (yet) available on your > > system. Did you first "pip" or otherwise download the library? > > > > (I have, and the code works happily) > > > > WebRefs: (modify to suit the version of Python in-use) > > https://docs.python.org/3/installing/index.html?highlight=pip > > https://docs.python.org/3/library/turtle.html > > > It worked for me as written above (Python 3.7, Windows 10). that's weird -- https://mail.python.org/mailman/listinfo/python-list
Re: Might be doing this wrong? (Turtle graphics)
On Wednesday, March 20, 2019, at 7:34:53 PM UTC-4, CrazyVideoGamez wrote: > So, I typed in code: > from turtle import * > forward(100) > right(120) > clear() > It didn't work! It kept on saying that there was an indent and the first line > was wrong. Help! wait no nevermind im such an idiot -- https://mail.python.org/mailman/listinfo/python-list
What is a, b, c, and d in: rect1 = drawing.create_rectangle(a, b, c, d) and circle1 = drawing.create_oval(a, b, c, d)
What is a, b, c, and d in: from tkinter import * window = Tk() drawing = Canvas(window, height=500, width=500) rectangle = drawing.create_rectangle(a, b, c, d) and: circle = drawing.create_oval(a, b, c, d) ??? -- https://mail.python.org/mailman/listinfo/python-list
What does at 0x0402C7B0> mean?
I tried doing a list comprehension. I typed: favorite_fruits = ['watermelon', 'blackberries'] print(fruit for fruit in favorite_fruits) And I got: at 0x0402C7B0> What does this mean and what do I have to fix? -- https://mail.python.org/mailman/listinfo/python-list
How do you insert an item into a dictionary (in python 3.7.2)?
How do you insert an item into a dictionary? For example, I make a dictionary called "dictionary". dictionary = {1: 'value1', 2: 'value3'} What if I wanted to add a value2 in the middle of value1 and value3? -- https://mail.python.org/mailman/listinfo/python-list
Re: Make sure the window title is visible in tkinter
On Wednesday, June 26, 2019, at 7:44:15 AM UTC-4, Cecil Westerhof wrote: > I need to write a desktop program. I choose to use tkinter. How can I > make sure the window title is visible? For example when I have the > following code: > from tkinter import Button, filedialog, Label, messagebox, Tk > > > window = Tk() > window.title('A long window title') > Button (window, text = 'Short text').pack() > window.mainloop() > > I see only a part of the 'A', but I would like to see the complete: > 'A long window title' > > -- > Cecil Westerhof > Senior Software Engineer > LinkedIn: http://www.linkedin.com/in/cecilwesterhof Maybe you should try to maximize the window so you can see everything. It put in your code and I could see more of the title. -- https://mail.python.org/mailman/listinfo/python-list
How Do You Replace Variables With Their Values?
How do you replace a variable with its value in python 3.7.2? For example, say I have: dinner = {'Starters':['Fried Calamari', 'Potted crab'],'Main Course':['Fish', 'Meat'], 'Desert':['Cake', 'Banana Split']} # Don't ask where I got the dinner from for meal in dinner.keys(): meal = list(dinner[meal] But I only get one list called "meal" and I'm just changing it with the code above (you can find that by printing it out). How can I make separate lists called 'Starters', 'Main Course', and 'Desert'? -- https://mail.python.org/mailman/listinfo/python-list
How Do You Replace Variables With Their Values?
How do you replace a variable with its value in python 3.7.2? For example, say I have: dinner = {'Starters':['Fried Calamari', 'Potted crab'],'Main Course':['Fish', 'Meat'], 'Desert':['Cake', 'Banana Split']} # Don't ask where I got the dinner from for meal in dinner.keys(): meal = list(dinner[meal]) But I only get one list called "meal" and I'm just changing it with the code above (you can find that by printing it out). How can I make separate lists called 'Starters', 'Main Course', and 'Desert'? -- https://mail.python.org/mailman/listinfo/python-list
Python Editor for mobile
Are there any good editors on Apple that don't cost money and already has matplotlib, numpy, and other modules already installed? -- https://mail.python.org/mailman/listinfo/python-list
Pygal bar colors
How do you change the color of the bar in pygal? I want to change it from red to blue. Help! -- https://mail.python.org/mailman/listinfo/python-list
Weird Python Bug
For some reason, if you put in the code def odd_ones_out(numbers): for num in numbers: count = numbers.count(num) if not count % 2 == 0: for i in range(count): numbers.remove(num) return numbers nums = [72, 4, 82, 67, 67] print(odd_ones_out(nums)) For some reason, it outputs [4, 67, 67] when it should have deleted the 4 because it was odd. Another interesting thing is that when you put print(num) in the for loop, the number 4 never shows up and neither does the last 67. Help! -- https://mail.python.org/mailman/listinfo/python-list
re not working
For some reason these are different: pattern = r'[0-9]{4,6}' And pattern2 = r'[0-9][0-9][0-9][0-9]([0-9]){0,2}' And when I try to match them import re re.search(pattern, '1234') and import re re.search(pattern2, '1234') are different. Help? -- https://mail.python.org/mailman/listinfo/python-list