0
I donât see why I canât get this working, I have a problem with line 4 and I think itâs the = but would appreciate input
4 RĂ©ponses
+ 1
age = int(input("how old are you? "))
print("have you really been alive for", age,"years?")
result = "input"
if input(result)=="yes": print("i knew that")
if input(result)== "no": print("oops")
what you had done is that you have compared input(result) using single = operator which is an assignment operator. you have to use double equals(==) operator here and also a colon (:) after if statement
+ 1
age = int(input("how old are you? "))
print("have you really been alive for", age,"years?")
result = input() #take input once only then use as
if result == "yes": print("i knew that")
if result == "no": print("oops")
#use == comparision operator to equality check
# the = is assignment operator
#put a colon : after if condition
0
Thanks for the feedback