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

+4

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

+4

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

+3

Umarbek Saidov variable declaration doesn't start with number. Already explained here https://www.sololearn.com/learn/Python/2428/

+2

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

+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?

-3

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

-4