4.1.1
Identifiers
Test your knowledge with free interactive questions on Seneca — used by over 10 million students.
Identifiers
Identifiers are the names given to variables, constants, and subroutines.

Variables
- Variables should have lowercase names, with each word separated by an underscore. For example:
- this_is_my_variable
- user_money
- Variable should also have descriptive names, for example user_money is much better than this_is_my_variable.

Constants
- Constants should be named using the same rules as variables, but uppercase.

Subroutines
- Subroutines should have lowercase names, with each word separated by an underscore. For example:
- calculate_sum()
- get_user_id()
- Subroutines should have descriptive names where possible.

Global rules
- In general, all identifiers should be descriptive.
- Characters which might be confused should be avoided, for example:
- 0 and O.
- 1 and l (lower case L).
1Introduction to Python
1.1Python
1.2Input & Output
1.3Data Types
1.4Variables & Constants
1.6Program Flow
2Data Structures
2.1Lists & Strings
2.2File Handling
3Modularity
3.1Subroutines
3.2Data Flow
4Good Practice
4.1Naming & Whitespace
4.2Comments
4.3Exceptions
Jump to other topics
1Introduction to Python
1.1Python
1.2Input & Output
1.3Data Types
1.4Variables & Constants
1.6Program Flow
2Data Structures
2.1Lists & Strings
2.2File Handling
3Modularity
3.1Subroutines
3.2Data Flow
4Good Practice
4.1Naming & Whitespace
4.2Comments
4.3Exceptions
Practice questions on Identifiers
Can you answer these? Test yourself with free interactive practice on Seneca — used by over 10 million students.
- 1
- 2
- 3Subroutines follow the same naming rules as:Multiple choice
Unlock your full potential with Seneca Premium
Unlimited access to 10,000+ open-ended exam questions
Mini-mock exams based on your study history
Unlock 800+ premium courses & e-books