NEW
Font size
Worksheetspython operators MCQ
Total questions: 45
Worksheet time: 15mins
Which python operator means 'less than or equal to'?
>=
>
<
<=
What is the value of the expression 100 / 25?
4
4.0
"4.0"
'4.0'
What is the output of the following code :
print 9//2
4.5
4.0
4
3
Which is the correct operator for power(x^y)?
X^y
X**y
X^^y
None of the mentioned
Which one of these is floor division?
/
//
%
None of the mentioned
What is the answer of this expression, 22 % 3 is?
7
1
0
5
x = 4.5
y = 2
print(x//y)
2.0
2
9
9.0
x = 5
print(x > 3 and x < 10)
True
False
x = 10
print(x > 3 and x < 9)
True
False
x = 8
print(x > 3 or x < 20)
True
False
x = 14
print(x > 10 or x < 3)
True
False
x = 5
print(x < 2 or x < 3)
True
False
x = 5
print(not(x > 3 and x < 10))
True
False
x = 5
print(not(x > 3 or x < 2))
True
False
x = 5
print(not(x > 6 or x < 3 ))
True
False
x = 5
y = 3
print(x == y)
True
False
x = "5"
y = 5
print(x == y)
True
False
x = 5
y = 3
print(x != y)
True
False
x = 10
y = 10
print(x != y)
True
False
x = 5
x%=3
print(x)
2
2.0
3
3.0
Which operator is known as ternary operator in python?
Assignment
Conditional
Relational
Comparative
Which symbol is used to print more than one item on a single line?
$
:
,
;
If p=25 , what is p**2?
50
125
600
625
c=35 if 34<43 else 43
34
43
35
1
Who developed python?
Ritchie
Bill gates
Guido van Rossum
Sunder
Which character is used to denote long integer?
D
N
LO
L
In Python script editor, the errors will be shown in ----- color in the IDLE window?
green
black
red
orange
Which is known as simple assignment operator?
==
=
+=
#
Which function accepts all data as string or characters but not as numbers?
int()
output()
input()
print()
print(7//2)
2
3
4
print(9>2 and 6<=6)
TRUE
FALSE
print(8!=8)
TRUE
FALSE
print(2**3)
6
12
8
print("3"+"3")
33
6
INVALID OUTPUT
print(2%2==0 or 3%2==0)
TRUE
FALSE
INVALID OUTPUT
print(4+"2")
6
42
TYPE ERROR
xy
x^^y
x^y
x**y
x pow y
the output of: x >= y
Adjust x so that it is greater than or equal y
True if x is greater than or equal y
x is shifted y bits to the right
False if x equals y in value
