Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок+ 2
Why even if I have no character in the middle of the variable name it is showing invalid character in identifier
2 ответов
+ 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
+ 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?