0
Friends,my code is right.But when I run the code it says 'File "file0.py" , line 37 def countdown(): in d SyntaxError: help me
13 Respostas
+ 2
Please put your code in a script on playground.
If you paste it in a comment its hard to read!
+ 2
you forgot an ending ')'
look at the line when you try and change the score label
+ 1
If it's a syntax error then your code is incorrect.
Please post it here
+ 1
Akshay Kumar Samantray as already said by Lisa Please put your code in a script on playground and share your code link with us
0
Please help me correct it
0
def countdown():
0
Line no.37
0
It was showing SyntaxError
0
def countdown ():
0
import tkinter
import random
colours = ('red', 'green', 'blue', 'pink', 'pink', 'black', 'cyan', 'purple', 'yellow', 'brown', 'white')
score = 0
timeleft = 30
def startGame(event):
if timeleft ==30:
countdown()
nextColour()
def nextColour():
global score
global timeleft
if timeleft > 0:
e.focus_set()
if e.get().lower() == colours(1):I
score += 1
e.delete(0, tkinter.END)
random.shuffle(colours)
label.config(fg = str(colours(0)))
scoreLabel.config(text = "Score: " + str(str(score))
def countdown():
global timeleft
if timeleft > 0:
timeleft -= 1
timeleft.config(text = 'Time Left: ' + str(timeleft))
timeLabel.after(1000, countdown)
root = tkinter.Tk()
root.title('COLOUR GUESSING GAME')
root.geometry("200Ć200")
instuructions = tkinter.Label(root, text='Tell me the colour of the word, not the word text', font=('Helvetica', 10))""
instuructions.pack()
.scoreL
0
Missing a closing bracket in the line above 37
0
What is closing bracket?
0
instuructions = tkinter.Label(root, text='Tell me the colour of the word, not the word text', font=('Helvetica', 10))""
instuructions.pack()
.scoreLabel = tkinter.Label(root, text='Press enter to start')
scoreLabel.pack()
label = tkinter.Label(root, font = ('Helvetica', 40))
label.pack()
e = tkinter.Entry(root)
root.bind('<Return>', startGame)
e.pack()
e.focus_set()
root.mainloop()