Font size
WorksheetsIT Specialist Exam Prep 1
Total questions: 25
Worksheet time: 47mins
What is the data type of the result of 5 // 2?
float
int
str
bool
Which of the following is a valid variable name in Python?
2nd_value
value-2
second_value
class
What is the result of type("3.14")?
<class 'float'>
<class 'int'>
<class 'str'>
<class 'bool'>
What is the result of 3 + 2 * 2?
10
7
9
12
Which operator is used for exponentiation in Python?
^
**
//
^^
What does "Python".lower() return?
PYTHON
python
Python
None
What will len("hello world") return?
10
11
12
None
How do you access the first item in a list called fruits?
fruits[1]
fruits(0)
fruits[-1]
fruits[0]
Which of the following is an immutable data type?
list
dictionary
tuple
set
What is the result of this code:
nums = [10, 20, 30]
nums.append(40)
print(len(nums))?
3
4
5
40
What is the following an example of and will it be True or False? (Choose 2)
if 3 == 4 and 3 >2
conditional
compound conditional
True
False
Which keyword is used to check multiple conditions in Python?
or if
elseif
elif
else if
What will this code output: for i in range(3): print(i)?
1 2 3
0 1 2
0 1 2 3
1 2
What loop should you use when you don’t know how many times to repeat?
for loop
while loop
repeat loop
do...while loop
What keyword is used to define a function in Python?
function
define
def
fun
What is the correct way to call a function named greet with one argument "Bob"?
greet = "Bob"
greet("Bob")
call greet("Bob")
def greet("Bob")
What is the default return value of a function that does not return anything?
0
False
None
Error
How do you import the math module?
import.math
math.import()
import math
use math
What does math.sqrt(16) return?
8
256
4
Error
What mode should you use to append to a file?
r
w
a
x
What function is used to read an entire file as a string?
file.read()
readline()
read()
open.read()
What type of error is this:
x = 5
print(X)?
NameError
TypeError
ValueError
ZeroDivisionError
What will happen if you try to divide by 0?
ValueError
SyntaxError
ZeroDivisionError
TypeError
What symbol goes in front of a comment?
--
#
@
_
What goes around docstrings?
--
#
" " "
" "
