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

Boolean MCQs

The document contains a series of multiple-choice questions (MCQs) focused on Boolean expressions and their evaluations in Python. Each question presents various expressions or conditions, asking the reader to determine which are true or false. The questions cover a range of topics, including logical operators, comparison operators, and specific conditions related to integers and characters.

Uploaded by

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

Boolean MCQs

The document contains a series of multiple-choice questions (MCQs) focused on Boolean expressions and their evaluations in Python. Each question presents various expressions or conditions, asking the reader to determine which are true or false. The questions cover a range of topics, including logical operators, comparison operators, and specific conditions related to integers and characters.

Uploaded by

22900vishav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Boolean MCQs

1.
Which of the following expressions is True?
a) 2>3
b) 3<4
c) 3!=3
d) 3>3

2.
Which of the following expressions is True?
a) 2>3 and 3<4
b) 2>3 and 3>4
c) 2<3 and 3>4
d) 2<3 and 3<4

3.
Which of the following expressions is True?
a) 2>3 or 3>4
b) 2<3 or 3<4
c) 2>3 or 2>2
d) 2!=2 or 2==3

4.
Which of the following expressions is False?
a) bool(0)
b) bool(9)
c) bool(-9)
d) bool(9.0)

5.
What will be the output of the following statement?
print(2 and 3)
a) 2
b) 3
c) True
d) False

6.
What will be the output of the following statement?
print(2 and 0)
a) 2
b) 0
c) True
d) False

8.
What will be the output of the following statement?
print(2 and -2)
a) 2
b) -2
c) True
d) False

9.
What will be the output of the following statement?
print(2 or 3)
a) 2
b) 3
c) True
d) False

10.
What will be the output of the following statement?
print(2 or 0)
a) 2
b) 0
c) True
d) False

11.
What will be the output of the following statement?
print(0 or 2)
a) 2
b) 0
c) True
d) False

12.
What will be the output of the following statement?
print(2 or 2<3)
a) 2
b) 3
c) True
d) False

13.
What will be the output of the following statement?
print(2<3 or 2)
a) 2
b) 3
c) True
d) False

14.
What will be the output of the following statement?
print(2 and 2<3)
a) 2
b) 3
c) True
d) False

15.
What will be the output of the following statement?
print(2<3 and 2)
a) 2
b) 3
c) True
d) False

16.
What will be the output of the following statement?
print('a' and 'b')
a) a
b) b
c) True
d) False

17.
What will be the output of the following statement?
print('' and 'b')
a) Empty string
b) b
c) True
d) False

18.
What will be the output of the following statement?
print('a' and '')
a) a
b) Empty string
c) True
d) False

19.
What will be the output of the following statement?
print('a' or 'b')
a) a
b) b
c) True
d) False

20.
What will be the output of the following statement?
print('' or 'b')
a) Empty string
b) b
c) True
d) False

21.
Which of the following expressions is True?
a) 'p'>='z' and 'p'>='a'
b) 'p'>='z' or 'p'>='a'
c) 'a' != 'b' and 'a'>'b'
d) 2>3 or 3>4

22.
Which of the following expressions is True?
a) 'Amar'>'am'
b) 'Am'>'Amar'
c) 'Amar'>'Amrita'
d) 'Amrita'>'Amar'

23.
Which of the following expressions is True?
a) 'force'>'fort'
b) 'Fort'>'Force'
c) 'Fort'>'Fortune'
d) 'Fortune'>'Misfortune'

24.
Which of the following expressions is True?
a) 'force'>'fort'
b) 'Fort'>'Force'
c) 'Fort'>'Fortune'
d) 'Fortune'>'Misfortune'

25.
Which of the following expressions is True?
a) not 5 or not 5<4
b) not 5 and not 5<4
c) not 5 and (not 5)<4
d) not (5 and not 5) <4

26.
Which of the following expressions is True?
a) 2>6<4
b) 2<6>4
c) 2>6>4
d) 2<6<4
27.
Which of the following expressions is True?
a) 2>6<14
b) 2<6>14
c) 2>6>14
d) 2<6<14

28.
Which of the following expressions is True?
a) 3>2>-2
b) 3<2<-2
c) 3>2<-2
d) 3<2>-2

29.
Which of the following expressions is True?
a) 5<=11<=8
b) 5>=11>=8
c) 5>=11<=8
d) 5<=11>=8

30.
Which of the following expressions is True?
a) False and False or not False
b) False and False and not False
c) False and False or False
d) False or False and not False

31.
Which of the following expressions is True?
a) False or not (False and False)
b) False or not False and False
c) False or not (False or True)
d) False or False and True

32.
Which of the following expressions is True?
a) True and False or not True
b) True and not True or False
c) True and not False or not True
d) not True and False or not True

33.
Which of the following expression checks the condition: num1 is equal to num2
a) num1=num2
b) num1==num2
c) num1<=num2
d) num1>=num2
34.
Which of the following expression checks the condition: num1 is a factor of num2
a) num1/num2==0
b) num1//num2==0
c) num1%num2==0
d) num2%num1==0

35.
Which of the following expression checks the condition: num1 is a multiple of num2
a) num1/num2==0
b) num1//num2==0
c) num1%num2==0
d) num2%num1==0

36.
36.
Which of the following expression checks the condition: num1 is a multiple of 3 or 5
a) num1%3 or 5==0
b) num1%3 or num1%5==0
c) num1%3==0 or num1%5==0
d) num1%15==0

37.
Which of the following expression checks the condition: ch (an integer) is a digit
a) ch>='0' and ch<='9'
b) '0'<=ch<='9'
c) 0<=ch<=9
d) ch>=0<=9

38.
Which of the following expression checks the condition: ch (a single character string) is a
digit?
a) ch>='0' or ch<='9'
b) ch>=0 or ch<=9
c) ch>='0' and ch<='9'
d) ch>=0 and ch<=9

39.
Which of the following expression checks the condition:
PR is less than 10, or TE is less than 23, or PR+TE is less than 33
a) PR>10 or TE>23 or PR+TE>33
b) PR>10, TE>23, PR+TE>33
c) PR<10 or TE<23 or PR+TE<33
d) PR<10, TE<23, PR+TE<33

40.
Which of the following expression checks the condition:
ENG is greater than 50, and at least one of MTH and PHY is greater
than 60
a) ENG>50 and MTH>60 or PHY>60
b) ENG>50 and (MTH>60 or PHY>60)
c) (ENG>50 and MTH>60) or PHY>60
d) ENG>50 and MTH and PHY>60

41.
Which of the following expression checks the condition:
For three given variables a, b, c, the sum of every pair of variables is greater than the third
variable.
a) a+b>c or b+c>a or c+a>b
b) a+b>c and b+c>a and c+a>b
c) a>b and b>c and c>a
d) a+b+c>b+c, b+c>c+a, c+a>a+b

42.
Which of the following expression checks the condition:
p is a two-digit integer and starts with 3 or it is a three-digit
integer ending in 5
a) 30<p<39 or 100<p<999 and p%5==0

b) p>=10 and p<=99 and p//10==3 or p%5==0

c) p//10==3 or p%5==0 and p<100 or p<999

d) 30<=p<=39 or 100<=p<=999 and p%10==5

43.
Which of the following expression checks the condition:
p is a two digit even number
a) p%2==0 and 10<=p<=99
b) p/2==0 and p>=10 and p<100
c) p%2==0 or p>=0 or p<=100
d) p%2==0 and p>10 and p<99

44.
Which of the following expression checks the condition:
ch (a single character string) is a lowercase consonant.
a) p=='a-z' - 'aeiou'
b) p=='a'<='z' or 'aeiou'
c) p in 'a-z' and p not in 'aeiou’
d) 'a'<=p<='z' and p not in 'aeiou'

45.
What condition is being checked by the following Python expression:
v=='AEIOU'
a) v is a 5 character string
b) v is a vowel
c) v is an uppercase vowel
d) v is exactly equal to 'AEIOU'
46.
What condition is being checked by the following Python expression:
ch in 'aeiou' or p in '0123456789'
a) ch is a vowel and p is a digit
b) ch is a lowercase vowel and p is a digit
c) ch is a lowercase vowel or p is a digit
d) ch is a vowel or p is a digit

47.
What condition is being checked by the following Python expression:
a>0 and b>0 and c>0 and a+b+c==180
a) a, b, c are positive numbers and their sum is 180
b) At least one of a, b, c is positive and their sum is 180
c) a, b, c are non-negative numbers which add up to 180.
d) The sum of a, b, and c is 180

48.
What condition is being checked by the following Python expression:
a>b>c or a<b<c
a) a, b, c are in ascending order
b) a, b, c are in descending order
c) a, b, c are in either ascending or in descending order.
d) None of these

49.
What condition is being checked by the following Python expression:
(x%y==0 or y%x==0) and x!=y
a) x is a factor of y or y is a multiple of x,
and x is not equal to y.
b) x is a multiple of y, or y is a multiple of x,
but x and y are unequal
c) x and y are unequal.
d) None of these

50.
The following condition will be True iff:
x%y==0 and y%x==0
a) x and y are 0
b) either x or y is 1
c) x and y are equal but not 0.
d) x and y are unequal

You might also like