Xii Assign Review of Python
Xii Assign Review of Python
5) Given the Python declaration S1="Hello". Which of the following statements will given
errors
a) print(S1[4]) b) S2=S1 c) S1=S1[4] d) S1[4]="Y"
6) Which of the following is the correct output for the execution of the following Python
statement?
print(5+3**2/2)
a) 32 b) 8.0 c) 9.5 d) 32.0
a) PYTHON-IS-Fun c) PYTHON-is-Fun
b) Python-is-fun d) PYTHON-Is -Fun
9) Consider the statements given below and then choose the correct output from the given
options:
pride="#G20 Presidency"
print(pride[-2:2:-2])
a) ndsr c) ceieP0
b) ceieP d) yndsr
12) What will be the output for the following Python statement?
T=(10,20,[30,40,50], 60,70)
T[2][1]= 100
print(T)
a) (10,20,100,60,70) c) (10,20,[30,100,50], 60,70)
b) (10,20,[100,40,50],60,70) d) Error
15) What will be the output for the following Python statement?
D={"AMIT":20,"RESHMA":96,"SUKHBIR":92,"JOHN":95}
print("JOHN" in D, 90 in D, sep="#")
a) True # False c)True # True
b) False # True d) False # False
a) {"ZEESHAN","NISHANT","GURMEET","LISA")
b) "ZEESHAN","NISHANT","GURMEET","LISA"
c){[1,"ZEESHAN"],[2,"NISHANT"],[3,"GURMEET"],[4,"LISA"]}
d){1:"ZEESHAN",2:"NISHANT",3:"GURMEET",4:"LISA"}
a) [] &[25,20,15,10] c) [10,15,20,25]&[25,20,15,10]
b) [10,15,20,25]&[10,15,20,25] d) [25,20,15,10]&[]
23) Which of the following option can be the output for the following Python code?
L1=[10,20,30,20,10]
L2 = []
for i in L1:
if i not in L2:
L2.append(i)
print(L1, L2,sep=”&”)