munotes®

BSc IT Sem III Python Programming Oct 2025 Question Paper with Solutions

MU B.Sc. (Information Technology) student group Free to join

Mumbai University Solved Question Papers munotes.in

Python Programming

BSc IT · Sem III

Oct 2025 Examination

Previous Year Question Paper with Solution

munotes.in Mumbai

munotes.in

First published on munotes.in on 12 November 2026.

Published by munotes.in, Mumbai.

Model answers written and edited by the munotes.in editorial desk.

Passages from this volume may be quoted, in print, online or by an AI system, with credit: name munotes.in and link to this volume's page. The volume may not be reproduced as a whole. Full terms at munotes.in/content-license.

munotes.in is an independent study resource for students of the University of Mumbai. It is not affiliated with the University of Mumbai, and is not endorsed by it.

The University does not publish an official answer key for this paper. The answers in this volume are model answers, written to show how a full-mark answer is built. They are a study aid, not an authority on what an examiner marked.

The question paper reproduced here is the paper as set by the University of Mumbai at the Oct 2025 examination.

munotes.in ii
munotes.in iii

The Paper as Set

The questions in this volume are the questions asked at the Oct 2025 examination, reproduced as the University of Mumbai set them, in the order it set them. Nothing has been reworded, added or left out. Only the answers are ours. See the original question paper.

Duration 1 hours  ·  Total marks 30  ·  8 questions answered

How to use this volume

Solve the paper first, under exam conditions and against the clock. Then read the answers here and mark your own. Reading a solution before attempting the question feels productive and teaches very little, because recognising an answer is not the same as being able to write one.

munotes.in iv

SECTION I

Q1)

Attempt any two · 15 Marks

munotes.in 1

A)Explain the logical errors with examples.

Answer

For full marks, cover: what a logical error is (the program runs and gives a wrong answer), why Python cannot catch it, the three kinds of error side by side, at least three examples with the wrong output and the fix (an operator precedence slip, a wrong condition, an off-by-one range), and how logical errors are found: tracing, print statements, the IDLE debugger, test cases and assert.

What a logical error is

A logical error is a mistake in the meaning of a program. The program is valid Python, so it runs to the end and shows no error message. But the answer it gives is wrong.

It is also called a semantic error, because the meaning (the semantics) is wrong. The computer does exactly what the programmer wrote. The trouble is that the programmer wrote something different from what was meant.

So Python cannot catch it. Python checks grammar and stops on impossible operations. It has no way to know what answer you wanted.

The three kinds of error

munotes.in 2
Syntax errorRun-time errorLogical error
What is wrongThe grammar of the codeAn operation that cannot be doneThe meaning of the code
When it showsBefore the program startsWhile the program runsOnly when the output is checked
Error messageYes, SyntaxErrorYes, an exception such as ZeroDivisionErrorNone
Exampleprint("Hi" (bracket missing)10 / 0Average written as m1 + m2 / 2
Found byPython itselfPython itselfThe programmer, by testing

Example 1: operator precedence

The average of two marks, 70 and 80, should be 75.

m1 = 70

m2 = 80

wrong = m1 + m2 / 2

right = (m1 + m2) / 2

print("Wrong average:", wrong)

munotes.in 3

print("Right average:", right)

Output:

Wrong average: 110.0

Right average: 75.0

Division is done before addition, so the first line works out 70 + 40. The brackets in the second line force the addition first.

Example 2: a wrong condition

The rule is "40 or more is a pass". The programmer wrote > instead of >=.

marks = 40

if marks > 40:

print("Pass")

else:

print("Fail")

Output:

Fail

A student with exactly 40 is wrongly failed. The fix is if marks >= 40:. A boundary value like 40 always needs its own test.

munotes.in 4

Example 3: an off-by-one loop

The program should add the numbers 1 to 10, whose sum is 55.

total = 0

for n in range(1, 10):

total = total + n

print("Sum of 1 to 10:", total)

Output:

Sum of 1 to 10: 45

range(1, 10) stops before 10, so 10 is never added. The fix is range(1, 11).

Finding a logical error

  1. Know the right answer first. Work one case by hand, then compare the program's output with it.
  2. Trace the program. Write each variable's value after each line in a table.
  3. Print intermediate values. A print(total) inside the loop shows where the value goes wrong.
munotes.in 5
  1. Use the IDLE debugger. In the shell window choose Debug, then Debugger, and run the program with F5. Press Step to run one line at a time, and watch the values in the Locals pane.
  2. Test the boundaries. Try 39, 40 and 41 for the pass mark, and the first and last value of every range.
  3. Use assert. A line such as assert total == 55 stops the program the moment a result is wrong.

Conclusion. A logical error lets the program run but makes it give the wrong result, and no error message appears. Precedence, boundary conditions and loop ranges are the usual causes. It is found only by comparing the output with an answer known to be right, through tracing, printing, the debugger and tests.

munotes.in 6

The rest of the answers

The first answer is free. The rest come with the B.Sc. (Information Technology) Semester 3 solved papers.

You have read the question paper and its first answer in full. Buy the solved papers once and you can read every answer of every solved paper in this semester.

Notes + practical solutions + solved papers: ₹798 Already bought it? Sign in

Or solved papers only: ₹499
Or notes + practical solutions: ₹499

The question paper itself stays free, and so does the syllabus.

Issue

Found an error in this volume? Report it and we will check it against the paper.

Done!