Python Homework 5
Python Homework 5
Introduction to Python
minMark = maxMark-average
if *****
maxMark = mark
mark = int(input("Enter next exam mark, -1 to end: "))
1
Homework 5 While loops
Introduction to Python
Challenge
2. (a) Write a program to count the number of sixes thrown in a simulation of a die being
thrown 6000 times.
Remember to import the Python module random at the start of the program.
To generate a random number between 1 and 6, use the statement
throw = random.randint(1,6) [7]
(b) Describe how you could test whether your program is working correctly. [4]
2
Homework 5 While loops
Introduction to Python
[Total 18 marks]