wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

PythonL4

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

If we want to make a choice between 0 and 16 but only pick even numbers ?

a)

random.randrange(0,16,2)

b)

random.randint(0,16)

c)

random.random()

2.

Which one of the following functions can make a selection of many values without repetition ?

a)

choice()

b)

choices()

c)

sample()

d)

randint()

3.

Which mode resets all the content of the file and writes in it ?

a)

"a"

b)

"x"

c)

"w"

d)

"r"

4.

Which functions writes in the file ?

a)

open()

b)

write()

c)

close()

d)

append()

5.

Which is the key function in working with files in Python?

a)

open()

b)

write()

c)

close()

d)

append()

6.

Which mode create a new file?

a)

"a"

b)

"x"

c)

"w"

d)

"r"

7.

Which functions changes the direction of your turtle?

a)

right()

b)

forward()

c)

backward()

8.

How can we draw with python ?

a)

using random

b)

using turtle

c)

using math

9.

Which function change the order of the list randomly?

a)

choice()

b)

choices()

c)

shuffle()

d)

sample()

10.

How can we pick more than one choice randomly?

a)

choice()

b)

choices()

c)

shuffle()

d)

sample()