This Python Identifiers Quiz helps you master the rules, conventions, and restrictions related to naming variables, functions, classes, and other elements. Learn what makes a valid Python identifier and avoid common naming mistakes.
Time limit: 0
Quiz Summary
0 of 15 Questions completed
Questions:
Information
You have already completed the quiz before. Hence you can not start it again.
Which of the following is a valid identifier in Python?
Correct
Incorrect
Question 3 of 15
3. Question
Can Python identifiers start with an underscore _?
Correct
Incorrect
Question 4 of 15
4. Question
Which of the following is not a valid Python identifier?
Correct
Incorrect
Question 5 of 15
5. Question
Which characters are allowed in Python identifiers?
Correct
Incorrect
Question 6 of 15
6. Question
Which of the following is the correct way to name a constant in Python (by convention)?
Correct
Incorrect
Question 7 of 15
7. Question
Is __init__ a valid Python identifier?
Correct
Incorrect
Question 8 of 15
8. Question
Which of the following naming styles is commonly used for functions in Python?
Correct
Incorrect
Question 9 of 15
9. Question
Which identifier name would indicate a private variable by convention?
Correct
Incorrect
Question 10 of 15
10. Question
What happens if you use a keyword as an identifier?
Correct
Incorrect
Question 11 of 15
11. Question
Which of the following is a valid class name according to Python naming conventions?
Correct
Incorrect
Question 12 of 15
12. Question
What is the output of the following code?
True = 5 print(True)
Correct
Incorrect
Question 13 of 15
13. Question
Which of the following identifiers implies a special method in Python?
Correct
Incorrect
Question 14 of 15
14. Question
Which naming convention should be used for global variables?
Correct
Incorrect
Question 15 of 15
15. Question
Which function helps check if a string is a valid Python identifier?
Correct
Incorrect
Summary
These MCQs help learners understand the rules and naming conventions of identifiers in Python — including valid characters, keyword restrictions, special methods, and PEP 8 style guidelines. Great for interview prep, coding assessments, and best practices.
At QuizOrbit, our team specializes in fun, informative quizzes across topics like general knowledge, technology, and entertainment. Boost your knowledge with our expert-designed quizzes.