Python Programs
Python Programs
Python Programs
Class XII
Note: Do this programs in your Notebook and write the output also.
Q1: WAP to input two numbers and display their sum and product.
salary and total savings inputted by the user (using nested if…else
Q7: WAP to find maximum, minimum and mean value from the list.
Q8: WAP to store students’ information like admission number, roll no,
Q9: Write a function LShift (Arr,n) in python which accepts a list Arr of
the list are shifted to the left Sample input Data of the list Arr=
[10,20,30,40,12,11], n=2
Q11: WAP python function to get a string from s given string where all
X= 3.1415926
Y= -12.9999
Q14: Write script to input two integers and find their LCM.
Generation Report.
number.
Q18: Write the output of the following code:
nonlocal a
a+=1
return a + b
return add
print (func(5))
Q19: consider the following function that takes two positive integer
parameters a
if a> 1:
if a % b == 0:
func1(int(a/b), b)
else:
func1(a, b+ 1)
a) What will be printed by the function call func1(24,2)?
b) What will be printed by the function call func1(84,2)?
c) State in one line what func1() is trying to calculate.
Q22: Write a function file_long() that accepts a filename and reports the
>>>out. close()
>>> open(“output.txt”).read()
******