Dice Rolling Simulator Mini Project

#######################################################
from random import randint
def functionDice(x,y):
    print("Here x is: ",x," Here y is: ",y)
    if int(x) < 7:
        while True:
            if int(x) == int(y):
                print("You Won")
                break
            elif int(x) != int(y):
                x = input("Please enter int between 1 to 6: ")
                functionDice(x,randint(1,2))
    else:
        print("Value is greater than 6")

while True:
    x = input("Please enter int between 1 to 6: ")
    y = randint(1,6)
    print("Here y is: ",y," Here x is: ",x)
    functionDice(x,y)

Comments

Popular posts from this blog

Asterisk-AMI

Mini-Max Sum solution in Python

Hackerrank Birthday Cake Candles Challenge Solution in Python