0
Syntax error with defining a variable (python)
With the attached code I get a syntax error on the def time() point info at the closing parentheses. Can someone explain the issue import random import time def time() b = 0 var1 = random.randint(800,900) while a < var1: print(time.time) b = b + 1 amount = input() x = 0 while x = 0: time() amount = amount - 1 if amount == 0: x = 0
3 Respostas
+ 2
There is a missing colon after def time().
0
Variable a in time() is not defined.
Also check your while-loop: the condition needs to be x == ? and it needs an exit condition
0
Lisa I figured it out with your help. Both if those were issues but i was still having some so i rewrote the code i think the same way im not positive and it didnt work but i realized i had imported time when i swapped the variable name and it worked