Editor

Python MCQ questions with answers

Pick a topic, choose an answer and see why it is right, with code you can run in the editor.

Quick test

One from each topic, with your score at the end.

Basics

Lists, tuples, dictionaries and sets

Functions, errors, classes and files

Questions

Are the answers checked?

Yes. Every question with code is run in Python 3 before it is published, and the marked answer must be exactly what the code prints or the error it raises.

Do these questions cover the CBSE Class 11 and 12 syllabus?

They cover the Python topics the CBSE syllabus and most first-year programming courses teach: data types, operators, strings, conditions, loops, lists, tuples, dictionaries, functions, exceptions and file handling. Each topic page links the lesson that teaches it.

Can I see why an answer is right?

Every question has an explanation of the right answer and the tempting wrong one, and the code opens in the editor so you can change it and run it again.

For a question a day, try the daily Python puzzle; to write code that is checked by tests, the coding challenges.