If Else in Python MCQs Exercise I

Ques 1 If Else


What is the output of the following Python Code?

li=[11,12,13]
if li[0]^li[0]:
    print("True")
else:
    print("False")

A True
B False
C Error
D None of these.

Ques 2 If Else


What is the output of the following Python Code?

li=[11,12,13]
if print(li[0]^li[0]):
    print("True")
else:
    print("False")

A 0
True
B 0
False
C 1
True
D 1
False

Ques 3 If Else


What is the output of the following Python Code?

p=1
if p==1:
    p*=2
if p==((p**2)/(p*p)):
    print(p)
else:
    print(p+1)

A 2
B 3
C 4
D 5

Ques 4 If Else


What is the output of the following Python Code?

p=1
q=2
if(p!=q) or (print("Hello",endl=" ")):
    print("scoder")
else:
    print("hello")

A Hello scoder
B hello
C scoder
D Hello hello