subject

#In the game Rock-Paper-Scissors, two opponents#simultaneously choose to throw either "Rock", "Paper",#or "Scissors". Rock beats Scissors, Scissors beats Paper,#and Paper beats Rock. If both players throw the same#object, the round is a tie.##Write a function called find_winner. find_winner will take#as input a list of 2-tuples, each representing a round of#Rock-Paper-Scissors. Each 2-tuple will contain two strings.#Each string will be either "Rock", "Paper", or "Scissors".#The first item in the 2-tuple will represent what Player 1#chooses in each round, and the second item in the 2-tuple#will represent what Player 2 chooses in each round.##find_winner should return the string "Player 1 wins!" if#Player 1 wins more games than Player 2. It should return the#string "Player 2 wins!" if Player 2 wins more games than#Player 1. It should return the string "It's a tie!" if the#two players win an equal number of times.##The number of times the two players tie is irrelevant to the#result: all that matters is who wins more rounds than the#other.##For example:## find_winner([("Rock", "Rock"), ("Rock", "Scissors"),# ("Paper", "Rock"), ("Scissors", "Rock")])##...would return "Player 1 wins!" because Player 1 wins#two round and Player 2 wins one round.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 03:10
Fill in the following program so that it will correctly calculate the price of the orange juice the user is buying based on the buy one get one sale.#include //main functionint main() { int cartons; float price, total; //prompt user for input information printf("what is the cost of one container of oj in dollars? \n"); scanf(" [ select ] ["%d", "%c", "%f", "%lf"] ", & price); printf("how many containers are you buying? \n"); scanf(" [ select ] ["%d", "%c", "%f", "%lf"] ", & cartons); if ( [ select ] ["cartons / 2", "cartons % 1", "cartons % 2", "cartons % price", "cartons / price", "cartons / total"] [ select ] ["=", "==", "! =", "< =", "> =", "< "] 0) total = [ select ] ["price * cartons", "cartons * price / 2 + price", "(cartons / 2) * price", "cartons / (2.0 * price)", "(cartons / 2.0) * price + price", "((cartons / 2) * price) + price"] ; else total = ((cartons / 2) * price) + price; printf("the total cost is $%.2f.\n", total); return 0; }
Answers: 2
question
Computers and Technology, 23.06.2019 06:40
How many nibbles can be stored in a 16-bit word?
Answers: 1
question
Computers and Technology, 23.06.2019 18:20
What is wi-fi infrastructure? a metropolitan area network that uses radio signals to transmit and receive data a communications technology aimed at providing high-speed wireless data over metropolitan area networks a means by which portable devices can connect wirelessly to a local area network, using access points that send and receive data via radio waves includes the inner workings of a wi-fi service or utility, including the signal transmitters, towers, or poles and additional equipment required to send out a wi-fi signal
Answers: 2
question
Computers and Technology, 24.06.2019 14:30
In a home that has 120 v service, there is an electric appliance that has a resistance of 12 ohms. how much power will this appliance consume? a. 10 w b. 120 w c 1200 w d. 1440 w
Answers: 1
You know the right answer?
#In the game Rock-Paper-Scissors, two opponents#simultaneously choose to throw either "Rock", "Paper...
Questions
question
Chemistry, 18.02.2021 02:10
question
Chemistry, 18.02.2021 02:10
question
English, 18.02.2021 02:10
question
History, 18.02.2021 02:10
question
Mathematics, 18.02.2021 02:10
question
Mathematics, 18.02.2021 02:10
Questions on the website: 13722362