NEW
Font size
WorksheetsPython Basics quiz
Total questions: 25
Worksheet time: 11mins
What is the type of 5/2 in Python?
int
float
str
bool
which of these is mutable?
tuple
string
list
int
what is the value of bool("")?
True
False
None
0
What is the output?
3
3.33
4
0
Which is correct syntax for taking integer input?
x=int(input())
x=input(int())
x=input()
x=int()
What is the output?
True
False
None
Error
Which operator has the highest precedence?
+
*
**
//
What does 5%2 return?
1
2
0
2.5
Which comparison is True?
5=="5"
5 is 5
5!=5
5>"5"
What is the output?
True
False
0
Error
What is the output?
A
S
Error
Nothing
When using if statements in Python, which of the following is true?
You can have multiple else blocks
elif can appear before if
Only one else block is allowed
if statements cannot be nested
What is the output?
Yes
No
0
Error
Which is the output?
True
False
1
Error
Which keyword is mandatory after "if" for alternatives?
elif
else
then
next
What is the output?
0,1,2,
1,2,3
0 1 2
Error
What is the output?
0,1,2
0 0 0
infinite loop
Error
What does range(1,6,2) generate?
[1,2,3,4,5]
[1,3,5]
[2,4,6]
[0,1,2,3,4,5]
What is the output?
0 1 2
0 1 2 3
1 2 3
Error
What is the output?
nohtyP
Python
Error
n
Which loop is best when the number of iterations is unknown?
for
while
do-while
infinte
What is the output?
[1,2,3,4]
[1,2,3]
7
Error
What is the output?
64
512
256
16
Output of: len("Python")
5
6
7
Error
Which of the following statements about python lists is correct?
Lists are immutable
Lists can contain mixed data types
Lists must have unique elements
Lists cannot contain another list
