wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

IT Specialist Exam Prep 1

Total questions: 25

Worksheet time: 47mins

Name
Class
Date
1.

What is the data type of the result of 5 // 2?

a)

float

b)

int

c)

str

d)

bool

2.

Which of the following is a valid variable name in Python?

a)

2nd_value

b)

value-2

c)

second_value

d)

class

3.

What is the result of type("3.14")?

a)

<class 'float'>

b)

<class 'int'>

c)

<class 'str'>

d)

<class 'bool'>

4.

What is the result of 3 + 2 * 2?

a)

10

b)

7

c)

9

d)

12

5.

Which operator is used for exponentiation in Python?

a)

^

b)

**

c)

//

d)

^^

6.

What does "Python".lower() return?

a)

PYTHON

b)

python

c)

Python

d)

None

7.

What will len("hello world") return?

a)

10

b)

11

c)

12

d)

None

8.

How do you access the first item in a list called fruits?

a)

fruits[1]

b)

fruits(0)

c)

fruits[-1]

d)

fruits[0]

9.

Which of the following is an immutable data type?

a)

list

b)

dictionary

c)

tuple

d)

set

10.

What is the result of this code:

nums = [10, 20, 30]

nums.append(40)

print(len(nums))?

a)

3

b)

4

c)

5

d)

40

11.

What is the following an example of and will it be True or False? (Choose 2)

if 3 == 4 and 3 >2

a)

conditional

b)

compound conditional

c)

True

d)

False

12.

Which keyword is used to check multiple conditions in Python?

a)

or if

b)

elseif

c)

elif

d)

else if

13.

What will this code output: for i in range(3): print(i)?

a)

1 2 3

b)

0 1 2

c)

0 1 2 3

d)

1 2

14.

What loop should you use when you don’t know how many times to repeat?

a)

for loop

b)

while loop

c)

repeat loop

d)

do...while loop

15.

What keyword is used to define a function in Python?

a)

function

b)

define

c)

def

d)

fun

16.

What is the correct way to call a function named greet with one argument "Bob"?

a)

greet = "Bob"

b)

greet("Bob")

c)

call greet("Bob")

d)

def greet("Bob")

17.

What is the default return value of a function that does not return anything?

a)

0

b)

False

c)

None

d)

Error

18.

How do you import the math module?

a)

import.math

b)

math.import()

c)

import math

d)

use math

19.

What does math.sqrt(16) return?

a)

8

b)

256

c)

4

d)

Error

20.

What mode should you use to append to a file?

a)

r

b)

w

c)

a

d)

x

21.

What function is used to read an entire file as a string?

a)

file.read()

b)

readline()

c)

read()

d)

open.read()

22.

What type of error is this:

x = 5

print(X)?

a)

NameError

b)

TypeError

c)

ValueError

d)

ZeroDivisionError

23.

What will happen if you try to divide by 0?

a)

ValueError

b)

SyntaxError

c)

ZeroDivisionError

d)

TypeError

24.

What symbol goes in front of a comment?

a)

--

b)

#

c)

@

d)

_

25.

What goes around docstrings?

a)

--

b)

#

c)

" " "

d)

" "