I Haz Codes

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Menu
great roll

Enter the code below into python. It is showing a simple dice game where if the dice is over 2 then it will display great roll. Change the code so it –
– Displays “amazing roll” instead of “great roll”
– Only displays “amazing roll” if the roll is 5 or 6.

import random
roll = random.randint(1,6)
print("You have rolled", roll)
if roll > 2:
    print("great roll")



Comments are closed.

Information