🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.2nd_name
  2. B.my-name
  3. C.my_name2
  4. 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 →