diff --git a/Python/task/python task done b/Python/task/python task done new file mode 100644 index 00000000..3c42d268 --- /dev/null +++ b/Python/task/python task done @@ -0,0 +1,29 @@ +import random + +player1 = input("Enter name of 1st player ") +player2 = input("Enter name of 2nd player ") +target = int(input("Enter target number: ")) +score1 = 0 +score2 = 0 +list= [1,2,3,4,5,6] +while True: + if (score1 < target) and (score2 < target): + input(f"{player1} Roll Dice") + dice1 = int(random.choice(list)) + print(f"Dice rolled: {dice1}") + score1 = score1+dice1 + input(f"{player2} Roll Dice") + dice2 =int((random.choice(list))) + print(f"Dice rolled: {dice2}") + score2 = score2+dice2 + print(f"{player1}'s Score: {score1}\n{player2}'s Score: {score2}") + if score1 > target: + score1 = score1-dice1 + if score2 > target: + score2 = score2-dice2 + if score2 == target: + print(f"{player2} has won") + break + if score1 == target: + print(f"{player1} has won") + break diff --git a/Python/task/screenshot_output.png b/Python/task/screenshot_output.png new file mode 100644 index 00000000..926a8bcb Binary files /dev/null and b/Python/task/screenshot_output.png differ diff --git a/Webdevelopment/task1 b/Webdevelopment/task1 new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/Webdevelopment/task1 @@ -0,0 +1 @@ +