Python
Python
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
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