0% found this document useful (0 votes)
53 views7 pages

Conditional MCQ

Uploaded by

Rekha Verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views7 pages

Conditional MCQ

Uploaded by

Rekha Verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

MOUNT OLYMPUS SCHOOL

MALIBU TOWNE, SECTOR-47, GURUGRAM


CLASS XI
SUBJECT-COMPUTER SCIENCE (083)
Q.1 Which one of the following is a valid Python if statement :

a) if a>=2 :

b) if (a >= 2)

c) if (a => 22)

d) if a >= 22

Q.2 Which of following is not a decision-making statement.

a) if-elif statement

b. for statement

c. if -else statement

d. if statement

Q.3 What does the following code print to console.

if True:

print(1001)

else:

print(2002)

a) 1001

b. true

c.2002

d. false

Q.5 What will be the output of the following Python code?

If 4+5==10:

print(“TRUE”)

else:

print(“false”)

print (“True”)

a. False

True

b. True

True
c. false

d. none

Q.6 What keyword would you use to add an alternative condition to an if statement?

a. else if

b. elseif

c. elif

d. None of the above

Q.8 Predict the output of the following code:

x=3

If x>2 or x<5 and x==6:

print(“ok”)

else:

print(“no output”)

a . ok

b. okok

c. no output

d. none of above

Q.9 Predict the output of the following code:

x,y=2,4

if(x+y= =10):

print(“true”)

else:

print(“false”)

a. true

b .false

c. no output

d. none

Q.10 Consider the following code segment:

a = int(input(“Enter an integer: “))

b = int(input(“Enter an integer: “))

if a <= 0:

b = b +1
else:

a=a+1

if a > 0 and b > 0:

print (“W”)

elif a > 0:

print(“X”)

if b > 0:

print(“Y”)

else:

print(“Z”)

What letters will be printed if the user enters -1 for a and -1 for b?

a) Only W

b. Only X

c. Only Y

d. Only Z

Q.11 If the user inputs : 2<ENTER>, what does the following code snippet print?

x = float(input())

if(x==1):

print(“Yes”)

elif (x >= 2):

print(“Maybe”)

else:

print (“No”)

a.Yes

b.No

c.Maybe

d.Nothing is printed

Q.12 What will be the output of given Python code?

str1=”hello”

c=0

for x in str1:

if(x!=”l”):
c=c+1

else:

pass

print(c)

a) 2

b. 0

c. 4

d. 3

Q.13 What does the following Python program display ?

x=3

if x == 0:

print (“Am I here?”, end = ‘ ‘)

elif x == 3:

print(“Or here?”, end = ‘ ‘)

else :

pass

print (“Or over here?”)

a) Am I here?

b. Or here?

c.Am I here? Or here?

d.Or here ?

Or over here?

Q.16 The ……………… statement forms the selection construct in Python.

a) If else if

b..if

c. For ;

d.for

Q.17 In Python, …………………. defines a block of statements.

a. Block

b.loop

c.indentation
d.{}

Show Answer

Q.18 An ……………… statement has less number of conditional checks than two
successive ifs.

a) If else if

b. if elif

c. if-else

d. none

Show Answer

Q.19 The……….. clause can occur with an if as well as with loops.

a) else

b. break

c. continue

d. none

Q.20 The ………….statement terminates the execution of the whole loop.

a) continue

b) exit

c. breake

d. break

Q.21 The ……….. operator tests if a given value is contained in a sequence or not.

a) In:

b) in

c. not in

d. none

Q.22 An empty /null statement in Python is …………….

a) pass

b. none

c. null
Q.23 The break and continue statements, together are called …………….statement.

a) Jump

b. goto

c. compound

d. none

Q.25 The two membership operators are ……….and …………

a) in, not in

b. true , false

c.=,==

d. none

Q.26 A graphical representation of an algorithm to solve a problem is called


……………

a) flow of data

b. barchart

c. flow chart

d. none

Q.27 What is the logical expression for the following

Either A is greater than B or A is less than C

a) A>B or A<C

b. A>B and A<C

c . A>Band C

d. A>B or C

Q.28 Name is rohit and age between 18 and 35

a) name==rohit and age >=18 and age<=35

b) name==rohit and age >=18 or age<=35

c) name==rohit or age >=18 and age<=35

d) none

Q.29 Donation in the range of 4000-5000 or guest=1

a) (donation>=4000 and donation<=5000) or guest==1


b) donation>=4000 or donation<=5000 or guest==1

c) donation>=4000 and (donation<=5000 or guest==1)

d) donation>=4000 and donation<=5000) or guest==1

Q.30 State which of the following statement are true .

1.If,elif ,else are not compound statement.

2.Else if can be used in python.

3.Indentation while working with blocks is not necessary in python.

4.A pass statement is a null operation;it does nothing.

a.1

b.2 ,3

c.3

d.4
Q31 A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

You might also like