Nexus Learn

Python Programming MCQs with answers

Python is the first language in many computer science degrees and a favourite for data science and AI. These questions cover the core ideas that appear in university exams and job screening tests.

Answered 0 / 10 Correct 0
1 Which built-in function returns the number of items in a list?
2 What is the output of print(type([]))?
3 Which of these data types is immutable?
4 What does 3 ** 2 evaluate to in Python?
5 Which keyword is used to define a function?
6 What does "abc"[::-1] return?
7 What numbers does range(2, 10, 3) produce?
8 Which block catches an error so the program does not crash?
9 What is the value of bool("")?
10 What does len({1, 2, 2, 3}) return?

More practice

Keep learning with the free course notes and slides or try the GPA calculator.