+ 4

this_is_a_normal_name = 7 123abc = 7

why this code is not working

5th Dec 2020, 4:22 PM
Umarbek Saidov
Umarbek Saidov - avatar
4 ответов
+ 4
Because a variable name can't start with a digit.
5th Dec 2020, 4:26 PM
Seb TheS
Seb TheS - avatar
+ 3
Umarbek Saidov variable declaration doesn't start with number. Already explained here https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2428/
5th Dec 2020, 4:25 PM
A͢J
A͢J - avatar
+ 1
I don't know, why similar rule exists. I don't like googling, but one good reason could be that programming languages want to allow numbers to have characters in it. You are atleast allowed to include characters b, e, o, x in numbers: b: binary representation e: 10th exponent representation o: octal representation x: hex representation If you were allowed to start variables with digits, then these representations or variable usage should be changed, because how could you know whether 0b1 is a variable or an integer in binary representation?
5th Dec 2020, 4:35 PM
Seb TheS
Seb TheS - avatar
- 3
I don , know why similar rula exists l don t like googling butone good reason could
16th Dec 2020, 8:01 AM
Abhishek Rajput
Abhishek Rajput - avatar