Amity International School, Sector - 1, Vasundhara SESSION 2021 - 22 Class Xii - Computer Science Python Revsion Tour - Revision Worksheet MCQ
Amity International School, Sector - 1, Vasundhara SESSION 2021 - 22 Class Xii - Computer Science Python Revsion Tour - Revision Worksheet MCQ
import random
Max=3
Div=1+random.randrange(0,Max)
for N in range(1,5):
print(100%Div, end="#")
print()
a. 0#0#0#0# b. 1#1#1#1 c. 2#2#2#2#
d. 3#3#3#
20. What is output of following code −
s = ''mnopqr ''
i = ''m ''
while i in s:
print('i', end= '' '')
(a) i i i i i i i i…….. (b) m m m m m ….. (c) m n
o p q r (d) no output
Code:
pay= _________
location= _________
if location == "Mumbai":
print ("I’ll take it!")
#Statement 1
elif location == "Chennai":
if pay < 100000:
print ("No way")
#Statement 2
else:
print("I am willing!")
#Statement 3
elif location == "Delhi" and pay > 40000:
print("I am happy to join")
#Statement 4
elif pay > 60000:
print("I accept the offer")
#Statement 5
else:
print("No thanks, I can find something better")
#Statement 6