Signed up recently but had issues with the confirmation email?
Click Forgot password and follow the reset steps. You can choose the same password you used when you signed up. This should then provide access.
Remember to check Spam and Junk. The email will be from auth@progressbytes.co.uk.
301.14 Random Number Generation
Practise exam questionsRandom Number Generation — Note 1 of 3
Generate numbers in range.
Use random.randint(a, b) to generate a random integer between a and b inclusive. You must import random first.
import random at the top of the programrandom.randint(1, 6) gives 1, 2, 3, 4, 5, or 6import random
dice = random.randint(1, 6)
print("You rolled: " + str(dice))
coin = random.randint(0, 1)
print("Heads" if coin == 1 else "Tails")Back to Random Number Generation
Specification notes for programming are in Paper 2.