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 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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

https://code.sololearn.com/c460mpoiq3WQ/?ref=app

10th Mar 2022, 4:27 PM
Vadooshee Cho
3 Answers
+ 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
10th Mar 2022, 4:34 PM
Blank
Blank - avatar
+ 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
10th Mar 2022, 4:34 PM
Jayakrishna 🇮🇳
0
Thanks for the feedback
10th Mar 2022, 11:08 PM
Vadooshee Cho