Python Output Based Quiz 5

Share with others

Enter detail and click on NEXT

Q41. Write the output of the following :

L = [78, 56, 68, 42, 28, 36]
L[4], L[5] = L[5], [4]
print(L)

Q42. Write the output of the following :

L = [78, 56, 68, 42, 28, 36]
L[4], L[5] = L[5], [4,3,2]
print(L[5][0])

Q43. Write the output of the following :

x="Hello"
def abc(x):
      x="Bye"
      print(x)
abc("hello")

Q44. Write the output of the following:

x="Hello"
def abc(y):
      global x
      x="Bye"
      print(x)
abc("hello")
print(x)

Q45. Which code is correct to print the following output:

b
bl
blo
blog

Q46. Write the output of the following:

a,b,c=7,8 ,9
a=a+b+c
b=a+b+c
c=a+b
print(c)

Q47. Write the output of the following:

a=10
b=36
print(a and b)

Q48. Write the output of the following :

a=10
b=36
print(a or b)

Q49. Write the output of the following:

A={1:1, 2:2, 3:3}
print(A.keys()==A.values())

Q50. Write the output of the following :

import random
for i in range(5):
      print(random.randint(i,i))


Share with others

Leave a Reply

error: Content is protected !!