python - Syntax error on line containing if statement -
i keep trying make simple guess number game python keeps saying code has syntax error. doing wrong?
import random takeone = input("guess number between 1 & 5") numberinit = random.randint(1,5) if "takeone" == "numberinit" print("your right") else: print("your wrong")
the syntax error you're getting following:
file "test.py", line 4 if "takeone" == "numberinit" ^ syntaxerror: invalid syntax
this means you're missing colon @ end of if
line. line should instead read:
if "takeone" == "numberinit":
Comments
Post a Comment