michaelp0730
1/19/2015 - 6:47 PM

Dice Game.py

import random
 
def rolldice():
	return random.randint(1, 6)
 
 
 
def main():
	while True:
		stop = input("Roll the dice? y/n: ")
		if stop and stop[0].lower() == "n":
			break
 
 
		# otherwise we roll the dice
		dice1 = rolldice()
		dice2 = rolldice()
 
		print("You rolled %d, %d" %(dice1, dice2))
 
		if dice1 == dice2:
			print("You rolled a double, you win!!!!")
 
		print()