NEW
Font size
WorksheetsQuiz | Challenge: Avatar generator
Total questions: 10
Worksheet time: 6mins
What is the total number of possible 'mouth' variations that can be drawn based on the code provided?
1
2
3
4
What is the mathematical probability that the avatar will be drawn with a 'smile'?
75%
33%
50%
25%
If 'bow_location_num' is 3, what happens regarding the bow?
The bow is drawn first.
An error occurs because 3 is not handled.
No bow is drawn at all.
The bow is drawn last.
Which feature of the avatar is 'hard-coded' and will be the same every time the script runs?
The eye size.
The mouth shape.
The presence of a bow.
The nose shape.
What is the probability of the avatar having a 'button' nose?
1/2
100%
1/3
1/4
In the order of execution, when is 'avatar.draw_eyes("medium")' called?
At the very end of the script.
Only if the bow_location_num is 1.
After the first bow check but before the nose check.
Before anything else is checked.
Which value(s) for 'mouth_shape_num' will result in the 'neutral' mouth shape?
1 and 2
No values; it is impossible to get a neutral mouth.
4
3
What is the probability that the bow is drawn AFTER the mouth?
0%
1/3
2/3
1/2
What would happen if 'random.randint(1, 4)' for the mouth accidentally returned a 5?
The mouth would be 'smile'.
No mouth would be drawn.
The mouth would be 'neutral'.
The script would crash.
If 'bow_location_num' is 1, why is the bow drawn at the beginning instead of the end?
The code checks 'bow_location_num == 1' before any other drawing functions.
The 'random' module always puts 1 first.
Because bows must always be drawn first in the 'avatar' module.
It is actually drawn at the end regardless.
