0
24th Aug 2018, 10:53 PM
Shimaa
Shimaa - avatar
1 Réponse
0
Here are some of the reasons. -> 'While' should be 'while' -> line 11: 'sleep' should be 'time.sleep' -> There was a ')' missing at the end of line 10 -> Your identation was wrong -> index = 0 should be inside the function -> 'import randint' should be 'import random' ----------------- I've fixed these and other problems in the code below. import webbrowser, time, random sites=["www.rwaq.org","www.facebook.com","www.google.com.eg","www.youtube.com","www.twitter.com","www.ask.fm","www.instagram.com"] def breaktime (): index = 0 while index <= 8 : webbrowser.open(random.choice(sites)) print("Take a rest") time.sleep (10) index +=1 breaktime()
24th Aug 2018, 11:22 PM
Just A Rather Ridiculously Long Username