Skip to main content

Introduction To Python — Part 1 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Introduction To Python — Part 1 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
Content updated Oct 14, 2026
These practice questions are independent study material, not an official commission answer key. ExamHub.pk is reviewing older question sets; check important facts against the relevant commission's syllabus or another primary source. Report a correction.
40

Practice Questions

Interactive test mode with detailed academic worked solutions

Live Progress | 0/40 answered
✓ 0 correct ✗ 0 wrong 0% score
Question 1 of 40

What is Python primarily used for?

Question 2 of 40

Who developed Python Programming Language?

Question 3 of 40

Which of the following is an advantage of Python?

Question 4 of 40

What is the role of the Python interpreter?

Question 5 of 40

Which programming paradigm is supported by Python?

Question 6 of 40

What is the syntax used to write comments in Python?

Question 7 of 40

Which type of Programming does Python support?

Question 8 of 40

Is Python case sensitive when dealing with identifiers?

Question 9 of 40

Which of the following is the correct extension of the Python file?

Question 10 of 40

How is a variable defined in Python?

Question 11 of 40

Is Python code compiled or interpreted?

Question 12 of 40

All keywords in Python are in . . . . . . . .

Question 13 of 40

Which of the following character is used to give single-line comments in Python?

Question 14 of 40

Which of the following is NOT a Python data type?

Question 15 of 40

What is the main purpose of a loop in Python?

Question 16 of 40

Which of the following is NOT a valid loop in Python?

Question 17 of 40

What is the purpose of a function in Python?

Question 18 of 40

How is a function defined in Python?

Question 19 of 40

Which of the following is used to define a block of code in Python language?

Question 20 of 40

Which keyword is used for function in Python language?

Question 21 of 40

What does the return statement do in a function?

Question 22 of 40

What is the purpose of a module in Python?

Question 23 of 40

Which of the following is a valid way to handle errors in Python?

Question 24 of 40

What is the purpose of the try and except blocks in Python?

Question 25 of 40

What is the role of the import statement in Python?

Question 26 of 40

What is the purpose of an if-statement in Python?

Question 27 of 40

Which of these is the definition for packages in Python?

Question 28 of 40

What is the output of print("Hello, " + "world!")?

Question 29 of 40

What does the range() function in Python generate?

Question 30 of 40

What will be the value of the following Python expression? 4 + 3 % 5

Question 31 of 40

Python supports the creation of anonymous functions at runtime, using a construct called . . . . . . . .

Question 32 of 40

What is the order of precedence in python?

Question 33 of 40

What does pip stand for python?

Question 34 of 40

Which of the following is true for variable names in Python?

Question 35 of 40

Which of the following functions is a built-in function in python?

Question 36 of 40

Which of the following is the use of id() function in python?

Question 37 of 40

Which one of the following is the use of function in python?

Question 38 of 40

Which of the following functions can help us to find the version of python that we are currently working on?

Question 39 of 40

What will be the output of the following Python program? i = 0 while i < 5: print(i) i += 1 if i == 3: break else: print(0)

Question 40 of 40

What is the order of namespaces in which Python looks for an identifier?

✓ Link copied to clipboard

💡 Examiner's Advisory for Programming & Software Development

In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search the practice question library

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →