WorksheetsQuiz 2
Total questions: 10
Worksheet time: 10mins
What is the output of the following code?
Well Done!
Wrong
The code will have no output
The code throws an Error
Which loop(s) is/are not available in Python?
For Loop
While Loop
Do While Loop
What happens when we execute the following code?
This is not syntactically correct Python code
The code will throw an error
The code executes properly and prints the value of result
The code gets stuck in an infinite loop
Which keyword in Python is used to create empty loops, empty functions, or empty continual statements?
break
continue
pass
raise
What arguments shall you pass in a for loop range function to print all even numbers between 11 and 30(included)?
# Code Syntax
for i in range(x,y,z):
print(i)
The respective values of x y z are mentioned in the following options with a space in between each value of x, y, and z. Choose the correct option.
12 31 1
11 30 2
12 31 2
11 31 2
What is the output of the following code?
*
***
****
*****
*
***
****
*****
*
**
***
****
*****
Error
What is the output of the following code?
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
5 4 3 2 1
5 4 3 2 1
5 4 3 2 1
5 4 3 2 1
5 4 3 2 1
0 1 2 3 4
0 1 2 3 4
0 1 2 3 4
0 1 2 3 4
0 1 2 3 4
None of the above
What is the output of the following code?
20 60 310
17 60 400
17 50 310
The code will throw an Error
Which of the following string methods is used for inserting values into placeholders inside a string?
split()
format()
join()
print()
What is the name of the built-in Python module that provides the classes/functions date, timedelta, and timezone?
datetime
date
time
dataclasses
