0% found this document useful (0 votes)
2 views2 pages

Model Paper Python

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Model Paper Python

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Model Question Paper- I

First/ Second Semester B.E Degree Examination, 2025-26


PYTHON PROGRAMMING (1BPLC105B/205B)
TIME: 03 Hours Max. Marks:100
Notes:
1. Answer any FIVE full questions, choosing at least ONE question from each MODULE
2. M: Marks, L: Bloom’s level, C: Course outcomes.
3.

Module - 1 M L C
a Explain the concept of type conversion in Python. Differentiate between implicit 08 L2 CO1
Q.1 and explicit conversion with examples.
b Develop a Python program with a while loop to display the Fibonacci sequence 08 L3 CO1
up to n terms entered by the user.
c Differentiate between a syntax error and a runtime error with examples. 04 L2 CO1

OR
a Describe the Collatz 3n + 1 sequence and explain how iteration and conditional 08 L2 CO1
Q.2 statements are used in its implementation.
b Develop a program that prints all numbers from 1 to 100 that are divisible by 3 08 L3 CO1
or 5 but not both. Use continue or break statements wherever suitable.
c What is meant by function composition? Illustrate with an example. 04 L2 CO1

Module – 2
a Explain the string operations in Python for slicing, concatenation, repetition, and 8 L2 CO2
Q.3 comparison with suitable examples.
b Define a list. How is it different from an array? Develop a Python statement to 6 L3 CO2
access the third element of a list: nums = [3, 6, 9, 12].
c Develop a program to count the number of words in a given line of text. 6 L3 CO2

OR
a Explain mutability in lists. Illustrate the difference between modifying a list and 8 L2 CO2
Q.4 creating a clone of it using examples.
b Develop a Python program to check if a string is a palindrome using slicing. 6 L3 CO2
c Develop a program that takes a list of numbers and returns a new list containing 6 L3 CO2
only the even numbers.
Module – 3
a Develop a Python program that counts the frequency of words in a paragraph using 8 L3 CO2
Q5 a dictionary and displays the top three most frequent words.
b What is masking in NumPy? Develop a program to illustrate masking to filter array 6 L3 CO3
elements.
c Explain the use of the ‘with’ statement in file handling with a program. 6 L2 CO4

OR
a Explain the key features and operations of Python dictionaries. How are they 8 L3 CO2
different from lists? Develop suitable program to illustrate insertion, deletion, and
lookup.
b Develop a NumPy program to: 6 L3 CO3
Create a 3×3 matrix of random integers.
Display its shape, transpose, and mean of all elements.
Model Question Paper- I

c Explain how binary files differ from text files in terms of content and operations. 6 L2 CO4
Illustrate with suitable program segments.
Module – 4
a Explain the use of random and time modules in Python. Develop a program that 8 L3 CO3
Q.7 simulates a simple stopwatch that records random time intervals and calculates
the average elapsed time.
b Explain the concept of namespaces in Python. Develop program to illustrate how 8 L3 CO3
variable lookup follows the LEGB (Local, Enclosing, Global, Built-in) rule.
c Differentiate between class attribute and instance attribute with suitable program 4 L2 CO5
segments.
OR
a Develop python script to create a module [Link] with functions for square, 8 L3 CO3
Q.8 cube, and factorial of a number. Import it in another file using all three import
variants. Demonstrates the usage of each of the imported function.
b Develop a custom module having function which calculates factorial of a number. 8 L3 CO3
Import this custom module to a program to calculate binomial coefficient.
c Explain the difference between ‘is’ and ‘==’ operators using immutable objects. 4 L2 CO5

Module – 5
a Create a Python class Point with attributes x and y. Demonstrate sameness using 8 L3 CO5
Q.9 ‘is’ operator, and show the effect of mutability when modifying one reference.
b Explain the need for exception handling in Python. Develop a program to 8 L3 CO5
illustrate: try, except, else, and finally blocks.
c What is operator overloading? Illustrate with example using __add__(). 4 L2 CO5

OR
a Develop a program to illustrate polymorphism by defining a common interface 8 L3 CO5
Q.10 method in two different classes.
b Outline the difference between pure functions and modifiers. Develop a program 8 L3 CO5
code illustrating both using a class BankAccount.
c Explain the role of finally clause with an example. 4 L2 CO5

You might also like