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 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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

27th Aug 2021, 1:33 PM
Akshay Kumar Samantray
13 Answers
+ 2
Please put your code in a script on playground. If you paste it in a comment its hard to read!
27th Aug 2021, 1:47 PM
Lisa
Lisa - avatar
+ 2
you forgot an ending ')' look at the line when you try and change the score label
27th Aug 2021, 1:48 PM
Slick
Slick - avatar
+ 1
If it's a syntax error then your code is incorrect. Please post it here
27th Aug 2021, 1:36 PM
Slick
Slick - avatar
+ 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
27th Aug 2021, 1:52 PM
Pariket Thakur
Pariket Thakur - avatar
0
Please help me correct it
27th Aug 2021, 1:34 PM
Akshay Kumar Samantray
0
def countdown():
27th Aug 2021, 1:41 PM
Akshay Kumar Samantray
0
Line no.37
27th Aug 2021, 1:41 PM
Akshay Kumar Samantray
0
It was showing SyntaxError
27th Aug 2021, 1:41 PM
Akshay Kumar Samantray
0
def countdown ():
27th Aug 2021, 1:42 PM
Akshay Kumar Samantray
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
27th Aug 2021, 1:44 PM
Akshay Kumar Samantray
0
Missing a closing bracket in the line above 37
27th Aug 2021, 1:46 PM
Slick
Slick - avatar
0
What is closing bracket?
27th Aug 2021, 1:47 PM
Akshay Kumar Samantray
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()
27th Aug 2021, 1:50 PM
Akshay Kumar Samantray