← Quiz: Python Variables and Data Types: all 15 questions
Quiz: Python Variables and Data Types · Question 2 of 15
Which is a valid variable name?
Which is a valid variable name?
- A.2nd_name
- B.my-name
- C.my_name2
- D.class
Answer & explanation
Correct answer: my_name2
Names can contain letters, digits and _, but can't start with a digit, contain "-", or be a keyword like class.
Can you get the rest right without peeking?
Take the timed Quiz: Python Variables and Data Types quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →