Lesson 6 - Consolidation Workbook
Lesson 6 - Consolidation Workbook
Python Programming
Learning & Skills Objectives
To understand how to use consolidate IF statements and learn the practical
use of sequencing IF statements to achieve a differentiated outcome.
Keywords
Consolidate, sequencing, differentiated, assign
Lesson Success Criteria
Remembering Level 4
I have improved my maths quiz based on feedback that I
received at the end of last lesson.
Understanding
I can add multiple IF statements to my program which
allows my program to achieve different outcomes.
Applying I can confidently assign data to variables anywhere in
a program and output those when and where desired.
Analyzing
Level 5
I have completed ALL of the tasks in today’s lesson
Evaluating INDEPENDENTLY.
I have used the random module to create random math
questions for my player.
Creating I have added more complex elements to my game such
as elements to stop my game from crashing.
Last lesson ...
t 5
a s Should store the
t l e m e
a n s e a g a player’s name
e
v st i o H a v n
a
H ue u ct i o
q introd
Tell the playe
Should inc r if they
rease the s got the quest
by 1 if righ c o r e ion
t and decre r ight or wrong
by 1 if wro a s e
ng.
The
ScoreFinal
is 5 out of 5Score Feedback
Mini Task
Rank: Total Genius one
Score is 4 out of 5
Score is 1 out of 5
that it gives the user a ‘rank’
according to their score (it will
Rank: Noob fall into one of these ranks).
Example ...
If the final score (after 5 questions) is 1 out of 5, the final score message will read:
import random
number1 = random.randint(1,10)
This line imports the random module so that we can access randint
which will generate our random number.
This means that we want a random number between 1 and 10. You
can change this to whatever you want, e.g.
random.randint(10,20) would give you a random number
between 10 and 20.
Mini Task Two
random.randint(1,10)
Open MathsQuiz.py in SCRIPT mode.
Extension – Can you comment the above code to explain what it is doing?
Mini Task Two