1
def Round1():
    ESC1 = str(random.randint(0,6))
    ESC2 = str(random.randint(0,6))
    ESC3 = ESC1 + ESC2
    Dice = input("Player 1's turn. Do you want to roll your 2 dice? (Y for yes and N for no)  ")
    if Dice == "Y" or "y":
        print("Player 1 rolled their 2 dice. They rolled a " + ESC1 + " and a " + ESC2)
        if int(ESC3) % 2 == 0:
            print("Player 1 got " + (ESC3 + 10) + "points")
    elif Dice == "N" or "n":
        sys.exit()
    ESC4 = str(random.randint(0,6))
    ESC5 = str(random.randint(0,6))
    ESC6 = ESC1 + ESC2
    Dice1 = input("Player 2's turn. Do you want to roll your 2 dice? (Y for yes and N for no)  ")
    if Dice1 == "Y" or "y":
        print("Player 2 rolled their 2 dice. They rolled a " + ESC4 + " and a " + ESC5)
        if int(ESC6) % 2 == 0:
            print("Player 2 got " + (ESC6 + 10) + "points")
    elif Dice1 == "N" or "n":
        sys.exit()
    while ESC6 > ESC3: #need help here
        print("Player 2 won round 1.")
        if ESC3 > ESC6:
            print("Player 1 won round 1")

i need help with the'while' part at the bottom of my code as it seems to not run when i run the function but the rest works perfectly fine.

Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268
  • 1
    `ESC3 = ESC1 + ESC2` -- this catenates the two numbers together, it does not sum them. This means that if `ESC1` is `"1"` and `ESC2` is `"3"`, then `ESC3` will be `"13"`. – Brian Cain Mar 07 '19 at 20:58
  • Read https://ericlippert.com/2014/03/05/how-to-debug-small-programs/ for tips on how to debug your code. – Code-Apprentice Apr 10 '19 at 20:41

0 Answers0