What is a Variables?
A Variables is a container used to store data values in program.
Example:
name = "Python"
age = 21
Variable Naming Conventions:
- Can contain letters, numbers, and underscore(_)
- Must start with a letter or underscore
- Cannot start with a number
- Cannot contain spaces
- Cannot use Python keywords
- special characters are not allowed
Multi-words Variable Names:
- Camel Case - Each word except the first, start with a capital letter.
Example:
studentName
employeeSalary
- Pascal Case - Each word start with a capital letter.
Example:
StudentName
EmployeeSalary
- Snake Case - each word is separated by an underscore character.
Example:
student_name
employee_salary
Top comments (0)