5. Variable namesΒΆ
In Python, variable names must start with a letter or underscore
_Accents are allowed!
Examples of valid names:
price,action,salary,_x,year_2011,average_salary
>>> a = 2
>>> price = 500
>>> print(a)
2
>>> print(price)
500
Examples of invalid names:
average salary,3x,1st,@,$
>>> 3x = "text"
File "<stdin>", line 1
3x = "text"
^
SyntaxError: invalid syntax
Define valid and invalid variables below
You have attempted of activities on this page
