NEW
Font size
Worksheetspython
Total questions: 19
Worksheet time: 14mins
Which of the following is NOT a built-in data type in Python?
list
dict
tuple
tree
What does type casting mean in Python?
Converting a list into a dictionary
Assigning a type to a function
Converting a variable from one data type to another
Declaring variables with type annotations
What will print("Python"[1:4]) display?
yth
ytho
Pyt
ython
What is the Boolean value of the expression 5 > 3 and 2 < 1?
True
False
1
None
What will print(10 // 3) gives output?
3.33
3
3.0
4
What is the error in the above code snippet?
Indentation Error
Syntax Error
Name Error
Type Error
Which of the following methods can be used to remove an element from a list in Python?
list.remove()
list.delete()
list.pop()
Both A and C
What does the append() method do to a list?
Adds an element to the beginning of the list
Adds an element to the end of the list
Removes an element from the list
Sorts the list in ascending order
Which of the following statements is used to return the data type of a variable in Python?
type(variable)
get_type(variable)
type_of(variable)
variable.type()
What is the output of the following expression?
3 * "hello"
hellohellohello
3hello
hello3
None
Which of these is a valid variable name in Python?
1variable
my-variable
my_variable
my variable
Which of the following is a comparison operator in Python?
+=
==
and
=
What is the result of this expression:
"Python"[::-1]
Python
nohtyP
nothyP
Error
Which of the following will remove whitespace from both ends of a string?
strip()
trim()
rstrip()
clean()
What will "hello".capitalize() return?
Hello
HELLO
hello
Error
What is the result of "abc" + 123?
abc123
abc 123
abc+123
Error
How do you feel when you wake up early for the internship?
"Excited for the new opportunities!"
"I’m totally ready to conquer the day!"
"I’ll just take this one coffee at a time."
"Me, questioning my life choices while my bed looks way too comfortable."
What is the result of: not (True and False)?
True
False
None
Error
What is the value of 5 + 3 * 2 in Python?
16
11
13
10
