+ 1

🤔 Hi! Could you help me? My first Code doesn't work 😓...some indent's error appears!

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

7th Nov 2019, 1:41 AM
mariachi 9999
mariachi 9999 - avatar
3 Antworten
+ 2
your line 10-16: if user_input == "quit": break elif user_input == "add": ^here is your problem,your indentation of elif should always be the same as 'if' so just add 2 spaces to all elif num1 = float(input("Enter a number: ")) num2 = float(input("Enter another number: ")) result = str(num1 + num2)
7th Nov 2019, 1:48 AM
Hoh Shen Yien
Hoh Shen Yien - avatar
+ 2
Your next problem is line 34-38: print("The answer is " + result) ^when you put print function after the elif functions,you have broken the if else statement,so basically the bottom 'else' is out else: () print("Unknown input") you can consoder something like if result != None: print("The answer is " + result) after the else statement
7th Nov 2019, 2:12 AM
Hoh Shen Yien
Hoh Shen Yien - avatar
0
Thx shiny! But It doesn't work yet 🤯
7th Nov 2019, 2:02 AM
mariachi 9999
mariachi 9999 - avatar