Page 1 of 1

Please provide a complete answer with proper steps and screenshot

Posted: Mon May 09, 2022 6:06 am
by answerhappygod
Please provide a complete answer with proper steps and
screenshot
Please Provide A Complete Answer With Proper Steps And Screenshot 1
Please Provide A Complete Answer With Proper Steps And Screenshot 1 (65.63 KiB) Viewed 35 times
3. Develop a simple game (save it as balls.py). In this game, there are three coloured balls, Red, Blue and Yellow. This game is played by two players: Player 1: user and Player 2: computer. At each round, players are asked to enter either 1 for Red, or 2 for blue or 3 for yellow. The game goes by the following rules: Red vs blue >> the player who chose Red wins a point. • Blue vs yellow >> the player who chose Blue wins a point. • Yellow vs Red >> the player who chose Yellow wins a point. • If both players choose the same colour, no points are won. The program terminates when either of the two players hits 3 points in total or when either of the players enters an empty string. At which point, the program prints out the name of the winner. For example, Please enter 1 for Red, 2 for Blue or 3 for Yellow: 2 Computer choice is 1 Your current score is O Computer score is 1 Please enter 1 for Red, 2 for Blue or 3 for Yellow: 3 Computer choice is 1 Your current score is 1 Computer score is 1 Please enter 1 for Red, 2 for Blue or 3 for Yellow: 1 Computer choice is 2 Your current score is 2 Computer score is 1 Please enter 1 for Red, 2 for Blue or 3 for Yellow: 1 Computer choice is 2 Your current score is 3 Computer score is 1 congratulations, you won the game!