subject

The code below takes the list of country, country, and searches to see if it is in the dictionary gold which shows some countries who won gold during the Olympics. However, this code currently does not work. Correctly add try/except clause in the code so that it will correctly populate the list, country_gold, with either the number of golds won or the string "Did not get gold". 1
2 gold = {"US":46, "Fiji":1, "Great Britain":27, "Cuba":5, "Thailand":2, "China":26, "France":10}
3 country = ["Fiji", "Chile", "Mexico", "France", "Norway", "US"]
4 country_gold = []
5
6 for x in country:
7 country_gold. append(gold[x])
8 country_gold. append("Did not get gold")

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:20
The reset circuit used on the four 3-bit counters analyzed in this activity reset the counts to zero (000). it makes sense for the up-counters to start at zero (000), but the down-counters should start at seven (111). what would you need to change so that the 3-bit binary down counter with j/k flip-flops you just created would reset to seven (111)?
Answers: 1
question
Computers and Technology, 22.06.2019 10:00
Wich technology can a website use to allow you to listen to a concert live over the internet?
Answers: 3
question
Computers and Technology, 22.06.2019 13:30
1. technician a says horsepower information can be used by consumers to compare the power of different automobile engines. technician b says that manufacturers will often list the horsepower output of their engines in the online service information. who is right?
Answers: 2
question
Computers and Technology, 23.06.2019 02:30
What is the power dissipated by a resistor with a current of 0.02 a and a resistance of 1,000 ? a. 200 w b. 20 w c. 0.4 w d. 4 w
Answers: 1
You know the right answer?
The code below takes the list of country, country, and searches to see if it is in the dictionary go...
Questions
Questions on the website: 13722362