Can anyone tell me why this program is not running? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can anyone tell me why this program is not running?

from tkinter import * from random import * def bgg(event): a=randint(0,6) a2=randint(0,6) fr2=frame().grid() colors=(''red'',''orange'',''blue'',''indigo'',''orange'',''violet'',''green'') col=colors[a] col2=colors[a2] fr=frame(r,width=720,height=1300,bg=col) fr.bind(''<button-1>'',bgg) fr.grid(row=0,column=0) label(fr2,text=''Hello World'',bg=col,fg=col2).grid(row=0,column=0) r=Tk() col=''red'' fr=frame(r,width=720,height=1300,bg=col) fr.bind(''<button-1>'',bgg) fr.grid(row=0,column=0) r.mainloop()

7th Jan 2020, 4:56 PM
Akshay Sonar
Akshay Sonar - avatar
3 Answers
+ 4
Akshay Sonar are you sure it is not an IndentationError ? The only thing I see is that it is not aligned with the other statements. You need to add a space at the beginning of the line.
7th Jan 2020, 6:35 PM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 2
Can you tell us what error you get ?
7th Jan 2020, 5:59 PM
Aymane Boukrouh
Aymane Boukrouh - avatar
0
Aymane Boukrouh [INACTIVE] It says syntax error on line 7
7th Jan 2020, 6:31 PM
Akshay Sonar
Akshay Sonar - avatar