Can someone tell me what is wrong with the if statements | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Can someone tell me what is wrong with the if statements

name = input("What is your name") print("How are you today",name) how = input() print(how,". me too") print("What do you like to do") like=input() print(like,". I also like to do that") print("What would you like to do today") print("1 for add") print("2 for subtract") answer = input() if answer:="1": a = int(input()) b = int(input()) print(a+b) if answer :="2": c = int(input()) d = int(input()) print(c-d)

31st Aug 2022, 2:25 PM
Abdulbasit
Abdulbasit - avatar
3 Answers
+ 2
Why are you using the walrus operator?
31st Aug 2022, 2:30 PM
Slick
Slick - avatar
+ 1
ok i will try thank you guys was busy so did not see
5th Sep 2022, 4:25 PM
Abdulbasit
Abdulbasit - avatar
0
what is the walrus operator
5th Sep 2022, 4:26 PM
Abdulbasit
Abdulbasit - avatar