wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Quiz | Challenge: Avatar generator

Total questions: 10

Worksheet time: 6mins

Name
Class
Date
1.

What is the total number of possible 'mouth' variations that can be drawn based on the code provided?

a)

1

b)

2

c)

3

d)

4

2.

What is the mathematical probability that the avatar will be drawn with a 'smile'?

a)

75%

b)

33%

c)

50%

d)

25%

3.

If 'bow_location_num' is 3, what happens regarding the bow?

a)

The bow is drawn first.

b)

An error occurs because 3 is not handled.

c)

No bow is drawn at all.

d)

The bow is drawn last.

4.

Which feature of the avatar is 'hard-coded' and will be the same every time the script runs?

a)

The eye size.

b)

The mouth shape.

c)

The presence of a bow.

d)

The nose shape.

5.

What is the probability of the avatar having a 'button' nose?

a)

1/2

b)

100%

c)

1/3

d)

1/4

6.

In the order of execution, when is 'avatar.draw_eyes("medium")' called?

a)

At the very end of the script.

b)

Only if the bow_location_num is 1.

c)

After the first bow check but before the nose check.

d)

Before anything else is checked.

7.

Which value(s) for 'mouth_shape_num' will result in the 'neutral' mouth shape?

a)

1 and 2

b)

No values; it is impossible to get a neutral mouth.

c)

4

d)

3

8.

What is the probability that the bow is drawn AFTER the mouth?

a)

0%

b)

1/3

c)

2/3

d)

1/2

9.

What would happen if 'random.randint(1, 4)' for the mouth accidentally returned a 5?

a)

The mouth would be 'smile'.

b)

No mouth would be drawn.

c)

The mouth would be 'neutral'.

d)

The script would crash.

10.

If 'bow_location_num' is 1, why is the bow drawn at the beginning instead of the end?

a)

The code checks 'bow_location_num == 1' before any other drawing functions.

b)

The 'random' module always puts 1 first.

c)

Because bows must always be drawn first in the 'avatar' module.

d)

It is actually drawn at the end regardless.