Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Python/task/Untitled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions Python/task/python task done
Original file line number Diff line number Diff line change
@@ -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)