NEW
Font size
WorksheetsAlgo Mystery school level round 2
Total questions: 20
Worksheet time: 10mins
What is the data type of the value 10 in Python?
int
string
boolean
float
Which of the following is a valid string in Python?
"hello"
"hello world"
'world'
'12345'
How do you read input from the user in Python?
Use the 'input()' function to read user input.
Employ the 'fetch()' command to retrieve user data.
Utilize the 'scan()' method for input collection.
Use the 'read()' function to get user input.
What is the output of print(type(3.14)) in Python?
Which data structure is used to store multiple items in a single variable in Python?
Array, Queue, Stack, Graph
Matrix, Tree, Heap, LinkedList
List, Tuple, Set, Dictionary
String, File, Object, Module
What is the correct way to create a list in Python?
my_list = '1, 2, 3'
my_list = [1, 2, 3]
my_list = {1, 2, 3}
my_list = (1, 2, 3)
How do you access the first element of a list named 'myList' in Python?
myList.get(1)
myList.first()
myList[0]
myList[-1]
What is the output of print('Hello' + ' World') in Python?
Hello, World!
Hello World
Hello World
HelloWorld
Which of the following is a mutable data type in Python?
list
tuple
set
dictionary
How do you convert a string to an integer in Python?
float('string')
int('string')
eval('string')
str('string')
What is the default return value of a function in Python if no return statement is used?
False
Undefined
Null
None
Which keyword is used to define a function in Python?
method
function
define
def
What is the output of print(len([1, 2, 3])) in Python?
5
2
4
3
How do you create a dictionary in Python?
A dictionary in Python can be created using {} or the dict() constructor.
A dictionary in Python can be created using [] or the list() constructor.
You can create a dictionary in Python by using () or the tuple() function.
A dictionary in Python is made with <> or the set() method.
What is the purpose of the input() function in Python?
The purpose of the input() function in Python is to read user input as a string.
The input() function retrieves data from a file.
The input() function converts strings to integers.
The input() function outputs data to the console.
What keyword is used to define a function in Python?
define
def
func
function
Which of the following is used to handle exceptions in Python?
finally
try
catch
except
What is the output of print(type(3.14)) in Python?
boolean
string
float
int
Which of the following is used to handle exceptions in Python?
finally
try
catch
except
What is the purpose of the 'return' statement in a function?
To exit the function
To print a value
To send a value back to the caller
To define a function
