+ 1
Why when I put elif to make a simple calculator it tells me that elif is an invalid syntax?
9 Answers
+ 3
To be honest: This task is too high for you at the moment .
If you do the first 4 lessons in python you will be able to do it.
+ 5
an if-elif-else block be like---
if condition:
statement
elif condition:
statement
elif (as many as you want):
statement
else:
statement
Put in mind that an if-elif block may not have any 'else' end.
Some common error of that block is,
1.IndentaionError: misuse of spaces
2. SyntaxError: if you forget to add ':' after condition
+ 3
Provide your code will help us to solve your problem.
+ 2
Martitxi you should use IF first then ELSE. And if more than 2 conditions then IF ELIF ELIF ELIF ELSE
And use the TAB key to INDENT which means
......:
...........
Space in the beginning of line when under a loop or If Else Conditions, functions or class.
You have mentioned IF USER INPUT EQUALS TO "ADD". But u have to first take a input from user to decide whether its add or subtract.
+ 2
Thx
0
This is my code
0
Please help me 😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭
0
Yes, the truth is that I'm a little impatient and I really wanted to know how to make a calculator 😅😅😅😅😅😅😅😅😅😅😅😅