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 2 of 3
Use random in game logic.
Random numbers are essential in games for dice rolls, card shuffling, enemy spawning, and guessing games. Combine random.randint() with loops and selection for game logic.
random.randint(1, 6)import random
secret = random.randint(1, 100)
guess = 0
while guess != secret:
guess = int(input("Guess (1-100): "))
if guess < secret:
print("Higher!")
elif guess > secret:
print("Lower!")
print("Correct!")Back to Random Number Generation
Specification notes for programming are in Paper 2.