QUESTION IMAGE
Question
question: 18
which of the following choices is a properly formed python variable name, meaning it is both legal in the python
language and considered good style?
user_age
userage
user!age!
1user_age
Brief Explanations
- In Python, variable names can only contain letters, numbers, and underscores. They cannot start with a number. So
1user_ageis invalid. - Variable names should follow naming conventions. In Python, the snake_case (lowercase letters with underscores separating words) is considered good style.
uSeRaGe(camelCase) is not the preferred style in Python (though it is a legal variable name).user!age!has invalid characters (!).user_ageis in snake_case and has only valid characters.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
user_age