Class XII UT 1 CS Set B
Class XII UT 1 CS Set B
Class XII UT 1 CS Set B
Section A
1. What is the output of following code:
T=(100)
print(T*2)
2. Identify the output of the following Python statements.
lst1 = [10, 15, 20, 25, 30]
lst1.insert( 3, 4)
lst1.insert( 2, 3)
print (lst1[-5])
3. Find output of the following Python code?
def add (num1, num2):
sum = num1 + num2
sum = add(20,30)
print(sum)
4. State True or False: “In a Python program, if a break statement is given in a nested
loop, it terminates the execution of all loops in one go.”
5. What will be the output of the following statement:
print(3-2**2**3+99/11)
6. Find the correct output of the code:
Section C
17. Write a function listcharge(Arr) in python, which accepts a list of numbers and
replace each even number by value 10 and multiply odd number by 5.
Where a=[10,20,23,45]
listchange(a)
Output:- [10,10,115,225]
18. Write a function str_reverse() to reverse a string
Sample string: “python123”
Expected output:- “321nohtyp”