Review of Python Quiz 10

Share with others

Welcome to your Review of Python Quiz 10

Q91. Write the output of the following

a, b = 15,23
a,b,a = a+7, b-2, b-4
print(a)

Q92. Write the output of the following:

T=[2, 3, 5, 4, 6, 8]
T[3:]= "amit"
print(T)

Q93. Write the output of the following:

L=["cs","ip","learn","ing","hub"]
L.append("blog")
L[0]="I love"
L.pop()
del L[1]
L[-1]="hub"
print(L)

Q94. Write the output of the following:

num1, num2 = (23, 45)
if num1 < num2:
     print("Hello")
     break
else:
     print("Morning")

Q95. Find error(s) in the following code(if any).


x= int(“Enter value of x:”) #Statement1
for in range [0,10]: #Statement2
     if x=y #Statement3
          print("They are equal") #Statement4
     else: #Statement5
          Print( "They are unequal") #Statement6

Q96. Parth has written few lines regarding the statement str = "csiplearning". Few of them are wrong. As a friend of Parth, identify the wrong statement.

1. print(str(5))
2. str[3] = "learn"
3. print(min(str))
4. print(max(str))

Q97. Identify me : I am a variable which is declared inside the function.

Q98. Identify me : I am a symbol which is used in Python for single-line comment.

Q99. Write the output of the following:

a=15
while a>0:
     print(a,end=' ')
     a=a-7
print(a)

Q100. Which operator has the second highest priority/precedence in the expression : 16-(4-2)*5+2**3*4


Share with others

Leave a Reply

error: Content is protected !!