import turtle n = int(input('Enter an odd integer greater than or equal to 3: ') wn = turtle.Screen() wn.title(str(n) + "pointed star") mac = turtle.Turtle() mac.color("blue", "green") #pen color, fill color mac.pensize(2)
2 Replies - 396 Views - Last Post: 18 April 2013 - 12:30 PM
showing improper syntax when defining wn variable
Posted 18 April 2013 - 12:14 PM
I'm currently writing a simple python program that draws and fills a star using turtle, with 'n' number of points by th user. For some reason when I run the very beginning of my code, I get a syntax error when defining my wn variable. does anyone know why this may be?
Replies To: showing improper syntax when defining wn variable
Re: showing improper syntax when defining wn variable
Posted 18 April 2013 - 12:19 PM
On line 3 you have more opening parentheses than closing parentheses. So it thinks line 5 is a continuation of line 3 and chokes because int(input(...)wn = turtle.Screen() is invalid syntax.
Page 1 of 1