Question Detail
Question
According to Python naming conventions, which of the following is a valid identifier?
Correct Answer
Option C is the correct answer.
Detailed Explanation
Page 17 states: 'An identifier can be a combination of uppercase letters, lowercase letters, underscores, and digits (0-9).' It also says 'Special characters such as %, @, and $ are not allowed within identifiers.' Page 18 adds: 'An identifier should not begin with a number. Hence, 2variable is not valid.' Therefore, 'my_variable' is valid.
Hint
Check the rules for valid identifier characters and starting characters on pages 17 and 18.