wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Quiz Girls in ICT Day

Total questions: 20

Worksheet time: 3mins

Name
Class
Date
1.

What is the correct file extension for a Python file?

a)

.py

b)

.python

c)

.pt

d)

.txt

2.

Which of these is a valid variable name in Python?

a)

2name

b)

name_2

c)

name-2

d)

name.2

3.

What is the output of: print(3 + 4 * 2)?

a)

14

b)

11

c)

10

d)

8

4.

What is the data type of: "Hello"?

a)

Integer

b)

String

c)

Boolean

d)

List

5.

Which function is used to take input from the user in Python?

a)

read()

b)

input()

c)

scan()

d)

type()

6.

What is the correct way to start a function in Python?

a)

function myFunc()

b)

def myFunc():

c)

create myFunc()

d)

start myFunc():

7.

Which symbol is used to write a comment in Python?

a)

//

b)

#

d)

**

8.

What will be the output of: print(True and False)?

a)

True

b)

False

c)

None

d)

Error

9.

Which Python keyword is used to start a loop?

a)

repeat

b)

loop

c)

for

d)

start

10.

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

a)

1 2 3

b)

0 1 2

c)

0 1 2 3

d)

1 2

11.

What is the length of this list: mylist = [1, 2, 3, 4]?

a)

3

b)

4

c)

5

d)

Error

12.

What does if do in Python?

a)

Loops code

b)

Defines a function

c)

Makes a decision

d)

Prints output

13.

What is the result of 5 // 2 in Python?

a)

2.5

b)

2

c)

3

d)

2.0

14.

What does len("hello") return?

a)

4

b)

5

c)

6

d)

Error

15.

What will print(10 % 3) output?

a)

1

b)

3

c)

0

d)

10

16.

Which one is a Boolean value in Python?

a)

Yes

b)

true

c)

True

d)

TRUE

17.

What will this code do? name = input("Enter your name:") print(name)

a)

It prints the user’s name

b)

It prints "name"

c)

It gives an error

d)

It prints nothing

18.

Which of these is NOT a data type in Python?

a)

String

b)

Integer

c)

Real

d)

Boolean

19.

What will print(2 == 2) return?

a)

True

b)

False

c)

2

d)

Error

20.

What keyword is used to exit a loop?

a)

exit

b)

stop

c)

end

d)

break