diff --git a/Python/task/Untitled.png b/Python/task/Untitled.png new file mode 100644 index 00000000..46119eb1 Binary files /dev/null and b/Python/task/Untitled.png differ diff --git a/Python/task/python task done b/Python/task/python task done new file mode 100644 index 00000000..b1f0dde0 --- /dev/null +++ b/Python/task/python task done @@ -0,0 +1,31 @@ +import random + +player1 = 0 +player2 = 0 +goal = int(input(" your goal:\n")) + +while (player1 < goal) and (player2 < goal): + input("Player 1 - press Enter to roll Dice!") + d1 = int(random.randint(1, 6)) + player1 = player1 + d1 + print(d1) + if player1 > goal: + player1 = player1 - d1 + if player1 == goal: + print("Player 1 Wins !") + break + + input("Player 2 - press Enter to roll Dice!") + d2 = int(random.randint(1, 6)) + player2 = player2 + d2 + print(d2) + if player2 > goal: + player2 = player2 - d2 + if player2 == goal: + print("Player 2 Wins !") + break + + print("Player 1 Score: ", player1) + print("Player 2 Score: ", player2) + +