Skip to main content

Module In Python — Part 1 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Module In 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
Verified for Commission Syllabus • Oct 14, 2026
40

Verified 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
★ FPSC ★ PPSC

What is a Python module?

Question 2 of 40
★ FPSC ★ PPSC

How can you use a module in Python?

Question 3 of 40
★ FPSC ★ PPSC

What is the purpose of the import statement in Python?

Question 4 of 40
★ FPSC ★ PPSC

What does the as keyword do when used with the import statement?

Question 5 of 40
★ FPSC ★ PPSC

What will be the output of the following code: import math print(math.pi)

Question 6 of 40
★ FPSC ★ PPSC

What is the purpose of the from ... import ... statement in Python?

Question 7 of 40
★ FPSC ★ PPSC

What is a namespace in Python?

Question 8 of 40
★ FPSC ★ PPSC

How can you access a function my_function from a module my_module in Python?

Question 9 of 40
★ FPSC ★ PPSC

What will be the output of the following code: from math import sqrt print(sqrt(16))

Question 10 of 40
★ FPSC ★ PPSC

How can you reload a module in Python?

Question 11 of 40
★ FPSC ★ PPSC

What is the purpose of the __init__.py file in a Python module?

Question 12 of 40
★ FPSC ★ PPSC

What is the purpose of the sys.path list in Python?

Question 13 of 40
★ FPSC ★ PPSC

What does os.link() do?

Question 14 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? import turtle t=turtle.Pen() t.resizemode(“examveda”) t.resizemode()

Question 15 of 40
★ FPSC ★ PPSC

What will be the output if we try to extract only the year from the following Python code? (time.struct_time(tm_year=2017, tm_mon=6, tm_mday=25, tm_hour=18, tm_min=26, tm_sec=6, tm_wday=6, tm_yday=176, tm_isdst=0)) import time t=time.localtime() print(t)

Question 16 of 40
★ FPSC ★ PPSC

Which of the following can be used to create a directory?

Question 17 of 40
★ FPSC ★ PPSC

What is returned by math.isfinite(float('inf'))?

Question 18 of 40
★ FPSC ★ PPSC

What will be the output of the following Python function, assuming that the random module has already been imported? random.uniform(3,4)

Question 19 of 40
★ FPSC ★ PPSC

How can you determine the path of the currently executing script in Python?

Question 20 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? import time t=(2010, 9, 20, 8, 45, 12, 6, 0, 0) time.asctime(t)

Question 21 of 40
★ FPSC ★ PPSC

Lambda functions cannot be pickled because:

Question 22 of 40
★ FPSC ★ PPSC

Which of the following will not be returned by random.choice("1 ,")?

Question 23 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code if the system date is 18th June, 2017 (Sunday)? tday=datetime.date.today() print(tday.weekday())

Question 24 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? import time time.asctime()

Question 25 of 40
★ FPSC ★ PPSC

Which of the following is not an advantage of using modules?

Question 26 of 40
★ FPSC ★ PPSC

The function used to alter the thickness of the pen to 'x' units:

Question 27 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? import turtle() t=turtle.Pen() t.goto(50,60) t1=t.clone() t1.ycor()

Question 28 of 40
★ FPSC ★ PPSC

Which of the following functions raises an error when an unpicklable object is encountered by Pickler?

Question 29 of 40
★ FPSC ★ PPSC

The number of lines drawn in each case, assuming that the turtle module has been imported: Case 1: for i in range(0,10): turtle.forward(100) turtle.left(90) Case 2: for i in range(1,10): turtle.forward(100) turtle.left(90)

Question 30 of 40
★ FPSC ★ PPSC

What does os.getlogin() return?

Question 31 of 40
★ FPSC ★ PPSC

Which of the following can be used to create a symbolic link?

Question 32 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? import turtle t=turtle.Pen() t.color(0,1,0) t.begin_fill() for i in range(0,4): t.forward(100) t.right(90)

Question 33 of 40
★ FPSC ★ PPSC

In top-down design every module is broken into same number of submodules.

Question 34 of 40
★ FPSC ★ PPSC

What is the value returned by math.floor(3.4)?

Question 35 of 40
★ FPSC ★ PPSC

To obtain a list of all the functions defined under sys module, which of the following functions can be used?

Question 36 of 40
★ FPSC ★ PPSC

What will be the output of the following Python function if the random module has already been imported? random.randint(3.5,7)

Question 37 of 40
★ FPSC ★ PPSC

Is the output of the function abs() the same as that of the function math.fabs()?

Question 38 of 40
★ FPSC ★ PPSC

What is the value returned by math.fact(6)?

Question 39 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? print(math.isinf(float('-inf')))

Question 40 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? random.randrange(0,91,5)

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 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 through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →