DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PUDCUHERRY TECHNOLOGICAL UNIVERSITY
Continuous Internal Assessment Test II Question paper Bachelor of Technology(Computer Science and Engineering)
II Year III Semester CSUC107 Python Programming held on 17.09.2025
Time: 1.5 Hours Answer ALL Questions Maximum:25 Marks
PART – A (2x5=10 marks) ANSWER ANY 5 QUESTIONS
Answer any two *questions are to be answered compulsorily
Course Outcomes Blooms
[Link]. Question Marks (C01/C02/C03/C04/C05/ Taxonomy
Combinations) levels
What is the output of the following code 2 CO1,CO2 L1
numbers = [1, 2, 3]
01 numbers2 = numbers
[Link](4)
print(numbers)
2 CO1,CO2 L2
02 Explain any two string methods with an example
What is the output of the following statements 2 CO1,CO2 L3
Program segment 1
nums = [10, 20, 30, 40, 50]
print(nums[-3:-1])
03* program segment 2
x = [[1, 2], [3, 4]]
y = x[:]
y[0][0] = 99
print(x)
Compare mutability and performance aspects of 2 CO1,CO2 L3
04 lists and tuples. When would you prefer a tuple
instead of a list? Give one situation.
2 CO1,CO2 L2
05 Illustrate the working of pop and del functions on a dictiaonary
What is the output of the following statements 2 CO1,CO2 L3
Program segment
s = "AI"
t=s
s += " Lab"
06*
print(s, t)
What is the output of the following statements
Program segment
print("xyyzxyzxzxyy".count(‘xyy’,2,11) )
Question 1 2 CO1,CO2 L3
Assess which of the following is more efficient and
explain why:
07* (a) Using for loop to append squares to a list
(b) Using list comprehension [x**2 for x in
range(1000)]
Question 2 what is the output
[x for x in range(1,10) if x%2=0]
08 Outline how does a zip function work 2 CO1,CO2 L1
09 Mention any two of ways of creating a dictionary 2 CO1,CO2 L1
PART – B (Answer any two questions from 1,2,3 and any two questions from 4,5,6 )15marks
Course Outcomes Blooms
[Link]. Question Marks (C01/C02/C03/C04/C05/ Taxonmy
Combinations) levels
01 Trace the output of the following python programs[step by 2.5 CO1,CO2 L3,L4
step iteration should be shown.
1
05 CO1,CO2 L3,L4
sentence = "Data Science with Python"
result = {word: len(word) for word in [Link]() if
02 len(word) > 4}
print(result)
print(max(result, key=[Link]))
matrix = ["abc", "def", "ghi"]
result = []
for row in matrix:
temp = []
03
for ch in row:
[Link](ord(ch))
[Link](temp)
print(result)
Given a paragraph, use a combination of string 05 CO1,CO2 L3,L4
methods, lists, and dictionaries to:
Remove punctuation
Convert to lowercase
05
Split into words
Create a dictionary showing word
frequency
Then, display the most frequent 5 words
with their counts.
06 Create a Python program that: 05 CO1,CO2 L3,L4
Stores each student’s data as a tuple
(name, marks_list).
Stores all students in a list.
Generates a dictionary mapping names
→ average marks.
Displays top 3 scorers in descending
2
order.