Why even if I have no character in the middle of the variable name it is showing invalid character in identifier | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Why even if I have no character in the middle of the variable name it is showing invalid character in identifier

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

23rd Jan 2021, 7:03 AM
∆BH∆Y
∆BH∆Y - avatar
2 Answers
+ 6
The only solution is to retype the because sometimes the character has some hidden special characters in it, mostly from internet examples: By the way, I've noticed some bugs in your code that may cause errors. ( 1 ) string.capitalize() will not change the value of the original string, therefore you have to assign it to a variable: ( 2 ) When performing comparisons with logical operators, and if you want to compare the same variable with different values, it should look like this: if variable == "value1" or variable == "value2": Additional: You dont need to have "str" before input() as it already takes string by default. https://code.sololearn.com/cdr5bf5TlSCA/?ref=app
23rd Jan 2021, 7:48 AM
noteve
noteve - avatar
+ 4
The problem is happening after the : of your if statements and before print(num operation num1) backspace from print until you delete the : then retype from there. Did you use TAB?
23rd Jan 2021, 8:05 AM
Rik Wittkopp
Rik Wittkopp - avatar