Please provide a complete answer with proper steps and screenshot

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Please provide a complete answer with proper steps and screenshot

Post 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 33 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!
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply