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

  • 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

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

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

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).
Jump to other topics
1

Computational Thinking & Algorithms

2

Programming

3

Hardware & Software

4

Data

5

The Internet

6

Online Safety & Security

Practice questions on Identifiers

Can you answer these? Test yourself with free interactive practice on Seneca — used by over 10 million students.

  1. 1
  2. 2
  3. 3
Answer all questions on Identifiers

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

Get started with Seneca Premium