0
Problem with a code
Hi. I have a problem and I'm asking for help because I can't deal with it. I tried to write a code for the calculator, but I still get the error: File "..\Playground\", line 17 elif user_input = "subtract": ^ SyntaxError: invalid syntax https://code.sololearn.com/cXe3wrPD5bjq/?ref=app
7 odpowiedzi
+ 3
It is happening because of wrong indent. There should be a space before any line in Python otherwise it will give error.
Check this edited by me
https://code.sololearn.com/ct211GEjP5va/?ref=app
+ 3
Check this once. If you will not follow this then you will get error in python.
https://www.google.com/amp/s/www.geeksforgeeks.org/statement-indentation-and-comment-in-python/amp/
+ 1
Oh, I see. Thank you. ;)
0
Thank you very much! Now I understand!
0
also in your example you use = as an assignment operator. you should be using == which is an comparison operator
0
Brave Tea which line do you mean?
0
the one you typed in your question. it’s in the syntaxError