0% found this document useful (0 votes)
34 views

Python

Uploaded by

Bhavya Sri
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)
34 views

Python

Uploaded by

Bhavya Sri
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
You are on page 1/ 2

AN

KALASALINGAM
ACADEMY OF
RESEARCH AND EDUCATION
DEE MED TO BE UNIVERSITY)
Medet ee. 3 ef uac Aot 1090, Aeoredlted hy NAO wteh "N arnda
Anen Nevet. Krtahnenket - 6r0t0. Brtvtatur (via)Vrmetannae (D0), Tem Nade lntoARieenttngaw.Aa.tn www.&mtdemtigsm.ae.tn

OFFICE OF DEAN -FRESHMAN ENGINEERING

SESSIONAL EXAMINATION -MAY 2023


Duration 90 Minutes
Course Code 211CSE1402
PYTHON PROGRAMMING Max. Marks 50.
Course Name
Date & Session 05.05.2023 /
Degree/Year/Sem: B.Tech. //II
SLOT 3

PART - A (5 x 2 = 10 Marks) Pattern Mapping Marks


Answer All Questions COs

Write a Python program to print a specified list after


removing the Oth, 4th and 5th elements.
Remember CO2 2
List : ['Red, 'Green', White, 'Black', "Pink, 'Yellow']
Expected Output : ['Green', "White', 'Black']
Remember CO2 2
2 Difference between Tuple and Set with examples.
Remember CO2 2
3 How to create modules in python with oneexample?
and
Define an inner function to calculate the addition
Remember CO3
4 subtraction and display their values.
(inner function named as calculation)
cannot
5 Every syntax error is an exception but every exception Evaluate CO4
be a syntax error .Justify the statemnent.

Pattern Mapping Marks


PART - B (2% x l6 =40 Marks)
COs
Answer AllQuestions
common. Ir
i) Check if two sets have any elements in Evaluate CO2 4

yes, display the commonelements.


Given:
setl = {10, 20, 30, 40, 50}
set2 (60, 70, 80, 90, 10}
Expected output:
6 Two sets have items in comnmon
{10}

ii) What is the minimum and maximun value in the Remember


tuple?
C02 4

tt=(66, 555, 11, 101,9, 1001)


4
ii)Write a Python program to replace the last element Remember CO2

in alist with another list

Sample data : [1, 3, 5, 7,9, 10], [2, 4, 6,8] 8]


Expected Output: [1, 3, 5,7, 9, 2, 4,6, Remember 4
iv) Get the key ofa minimum value from the following
CO2

dictionary
sample dict ={
"Physics': 82,
'Maths': 65,
'history': 75

Expected output:
Maths 6
Replace character cl with Remember CO3
i) Givena string S, cl and c2.
and Lambda
c2 and c2 with cl.use Map function
expression in Python to replace characters
Input :str ='grrksfoegrks'
cl =e, c2 =r
Output : geeksforgeeks
parameter CO3 5
ii)Define a function named as add with two Remember
arguments.
7 and provide the default values to the
Given Input : Add(x,y)
rollnumber and Remember CO3
iiil) Define a function that accepts or absent.
present
returns whether the studernt is
Hint
Use a list to store sample roll. no.
if the number
Get input from a user and check
exist in the list or not, if exists return present
else return absent
Define the following: Exception handling, throwing an Remember CO4

exception and catching an exception with one example.

Assessment Pattern as per Bloom's Taxonomy: Total


Analyze Evaluate Create
COs Remember Understand Apply
4 22
CO2 2+2+2+4+4+4 18
CO3 2+6+5+5 10
C04 6 50
Tota! 44

You might also like