this_is_a_normal_name = 7 123abc = 7 | Sololearn: Learn to code for FREE!


this_is_a_normal_name = 7 123abc = 7

why this code is not working

12/5/2020 4:22:59 PM

Umarbek Saidov

6 Answers

New Answer


Because a variable name can't start with a digit.


Umarbek Saidov variable declaration doesn't start with number. Already explained here


Naming a variable using a number at the beginning is a bad practice and results in an error. You can perhaps modify it as such: a123bc= 7


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?


I don , know why similar rula exists l don t like googling butone good reason could