Search SchoolNGR

Wednesday, 08 April 2026
Register . Login

Which of the following is a valid variable name in Python?

Which of the following is a valid variable name in Python?
Take Free Practice Test On 2026 JAMB UTME, Post UTME, WAEC SSCE, GCE, NECO SSCE
  • A My_variable$
  • B My_variable
  • C My-variable
  • D 1my_variable
Correct Answer: Option B
Explanation:
Variable names in Python must start with a letter or underscore, and can only contain letters, numbers, and underscores. The other options are invalid because they either start with a number (option C) or contain a special character (option D).

Share question on: