Random Numbers - Categories

Drag answers into the correct category. Once all of the answers have been categorised press submit to check your answers.

Valid Random Number Code
Invalid Random Number Code

Answers
import random
coin = random.randint(1,2)
if coin == 1:
     print('Heads')
else:
     print('Tails')
import random
dice1 = random.randint(1,6)
dice2 = random.randint(1,6)
total = dice1 + dice2\nprint('Total: ', total)
import random
dice = random.randint(1,6)
print(dice)
import random
print(Bulbasaur used tackle)
hit = random.randint(1,100)
if hit > 10:
     dmg = random.randint(3,11)
     print(Charmander took, dmg, damage!)
else:
     print(Bulbasaur missed!)
import random
print('Bulbasaur used tackle')
hit = random.randint(1,100)
if hit > 10:
     dmg = random.randint(3,11)
     print('Charmander took', dmg, 'damage!')
else:
     print('Bulbasaur missed!')
dice = random.RandInt(1:6)
Log in or sign-up to access the categorising activity



Don't have a login?

You can still revise this topic