Mumbai University Solved Question Papers munotes.in
Introduction to Programming with Python
BSc CS · Sem 1
Nov 2022 Examination
Previous Year Question Paper with Solution
munotes.in Mumbai
Mumbai University Solved Question Papers munotes.in
Introduction to Programming with Python
BSc CS · Sem 1
Nov 2022 Examination
Previous Year Question Paper with Solution
munotes.in Mumbai
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 Nov 2022 examination.
The questions below are the paper as the University of Mumbai set it at the Nov 2022 examination, in the order it was set.
MarksPage
MarksPage
The questions in this volume are the questions asked at the Nov 2022 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 2½ hours · Total marks 75 · 24 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.
Q.1 Answer the following
Attempt any four · 20 Marks
Answer
For full marks, cover: what a comment is and why it is written; the single-line and the inline comment; how several lines are commented, and the triple-quoted string; the docstring and how it differs from a comment; a program with output; good practice.
A comment is a note written in a program for a human reader. Python ignores it completely. It is never run and never reaches the bytecode. Comments explain what a part of the program does and, more usefully, why it does it. A comment that only repeats the code is worth nothing; a comment that gives the reason saves the next reader time.
A comment starts with the hash sign # and runs to the end of the line. It can sit on a line of its own, above the code it explains.
A comment can also follow code on the same line. Everything before the # runs; everything after it is ignored. Leave at least two spaces before the #, so the comment stands apart from the code.
Python has no multi-line comment like /* ... */ in C. To comment several lines, put a # at the start of each one. IDLE and most editors do this for a selected block in one step.
A triple-quoted string that is not stored anywhere is often used as a multi-line comment. Strictly it is a string that Python builds and throws away, not a comment.
A docstring is a string written as the first statement of a function, module or class. Unlike a comment, Python keeps it. It is stored in the object's __doc__ attribute and shown by help().
# Total and average of three marksmarks = [78, 65, 92] # marks out of 100total = sum(marks) # add the three marks"""This string is not a real comment.Python builds it and throws it away."""def average(values): """Return the average of a list of numbers.""" return sum(values) / len(values)print("Total:", total)print("Roll #7") # the # inside quotes is printedprint("Average:", round(average(marks), 2))print(average.__doc__)Output:
Total: 235Roll #7Average: 78.33Return the average of a list of numbers.
Line 1 is a single-line comment, and lines 2, 3 and 12 carry inline comments. None of them appears in the output. A # inside quotes is part of the string, so "Roll #7" is printed in full. The docstring was kept, so average.__doc__ printed it.
Conclusion. A comment begins with # and runs to the end of the line, and Python ignores it. Several lines are commented with a # on each, while a docstring is a kept string that __doc__ and help() can read.
The rest of the answers
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.
What do you need?
Tap one.
The answers are on this page
You can read the first answer here. The box further down shows how to read all of them.
Read it here, any time
We keep checking and updating our papers and notes, and adding more. A saved copy would be an old version. Reading on munotes.in always gives you the latest one.
I paid, but I can't open it
Please type an email, or a 10-digit phone number.
Done
If we find your payment, we send a link to the email you paid with. Open it to read.
Check your email in 2 minutes. Also check Spam.
No email after 10 minutes?
Something else
Please write a little more, so we can help.
Your email app opens with this. You can add more there. We reply by email.
Found an error in this volume? Report it and we will check it against the paper.