1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Advocard [28]
3 years ago
13

(PYTHON) Complete the program to print out nicely formatted football player statistics. Match the following output as closely as

possible -- the ordering of players is not important for this example.
2012 quarterback statistics:
Passes completed:
Greg McElroy : 19
Aaron Rodgers : 371
Peyton Manning : 400
Matt Leinart : 16
Passing yards: ...
Touchdowns / Interception ratio:
Greg McElroy : 1.00
Aaron Rodgers : 4.88
Peyton Manning : 3.36
Matt Leinart : 0.00
quarterback_stats = {
'Aaron Rodgers': {'COMP': 371, 'YDS': 4925, 'TD': 39, 'INT': 8},
'Peyton Manning': {'COMP': 400, 'YDS': 4659, 'TD': 37, 'INT': 11},
'Greg McElroy': {'COMP': 19, 'YDS': 214, 'TD': 1, 'INT': 1},
'Matt Leinart': {'COMP': 16, 'YDS': 115, 'TD': 0, 'INT': 1}
}

print('2012 quarterback statistics:')

print(' Passes completed:')
for qb in quarterback_stats:
comp = quarterback_stats[qb]['COMP']
#print(' %?: %?' % (qb, comp)) # Replace conversion specifiers
# Hint: Use the conversion flag '-' to left-justify names

print(' Passing yards:')
for qb in quarterback_stats:
print(' QB: yards')

print(' Touchdown / interception ratio:')
# ...
# Hint: Convert TD/INTs to float before calculating ratio
Computers and Technology
1 answer:
loris [4]3 years ago
3 0

Answer:

quarterback_stats = {

'Aaron Rodgers': {'COMP': 371, 'YDS': 4925, 'TD': 39, 'INT': 8},

'Peyton Manning': {'COMP': 400, 'YDS': 4659, 'TD': 37, 'INT': 11},

'Greg McElroy': {'COMP': 19, 'YDS': 214, 'TD': 1, 'INT': 1},

'Matt Leinart': {'COMP': 16, 'YDS': 115, 'TD': 0, 'INT': 1}

}

print("2012 quaterback statistics: ")

print("Passes completed: ")

for qb in quaterback_stats.keys():

   print(f"{quaterback_stats[qb]} : {quaterback_stats[qb]['COMP']}")

print("Passing yards:")

for qb in quaterback_stats.keys():

   print(f"{quaterback_stats[qb]} : {quaterback_stats[qb]['YDS']}")

print("Touchdown / interception ratio")

for qb in quaterback_stats.keys():

   if quaterback_stats[qb]['TD'] > 0 and quaterback_stats[qb]['INT'] > 0:

       print(f"{quaterback_stats[qb]} : {float(quaterback_stats[qb]['TD']) / float(quaterback_stats[qb]['INT])}")

   else:

       print(f"{quaterback_stats[qb]} : {0.0}")

Explanation:

The python program gets data from a dictionary called quaterback_stats which holds the data of football players with their names as the keys and a list of records as the value.

The program prints the individual records from the dictionary using a for loop statement on the list of dictionary keys (using the keys() method).

You might be interested in
Arrange these steps of creating a presentation in the correct order. (notice that the given order is incorrect other than the ba
DedPeter [7]

Answer:

1) select the template option from the presentation wizard

2) select the background of your slideshow

3) assign animation to your slide​

4) click create presentation

Explanation:

not gonna lie, this was very confusing

hope it helps

3 0
3 years ago
What feature allows you to access previous copies of a document on OneDrive?
irga5000 [103]

Version history feature

OneDrive's Version history feature allows you to view older versions of an Office Online document. If you find a version you want, you can then restore it, moving it to the top of the list as the latest version of the file.

3 0
3 years ago
Read 2 more answers
What are the positive impact of computer in society
Brrunno [24]

Answer:

we can communicate many peoples

8 0
3 years ago
(tco 2) c++ comments are represented by which characters?
Margarita [4]
(TCO 2) In C++ terminology, (Points : 4) a ... a class object is the same as a class instance. a class object is the same as a class member. a class object is the same as a class access specifier.
4 0
3 years ago
In G mail, when we want to write an email to multiple recipients in such a way that the recipients couldn't understand that we h
Inessa05 [86]

Answer:

Bcc

Explanation:

Every recipient email address you enter into the “to” and “cc” fields will be able to see each other. The email addresses you add to the “bcc” field will not be visible to the “to” and “cc” recipients or the other “bcc” recipients.

7 0
3 years ago
Read 2 more answers
Other questions:
  • An Alias is a nickname???
    7·1 answer
  • Ethics in businesses and organizations are made up of a set of moral principles that guide the organizations. Discuss how good w
    8·1 answer
  • __________ is a protocol used by e-mail clients to download e-mails to your computer.
    14·1 answer
  • In one to two sentences, explain why citizens pay taxes
    8·1 answer
  • Which of the following would be an appropriate use of a check box control?
    15·1 answer
  • Refer to the exhibit. A network security analyst is using the Follow TCP Stream feature in Wireshark to rebuild the TCP transact
    8·1 answer
  • Write a script that checks to see if at least one argument has been given on the command line and tests whether the argument is
    5·1 answer
  • Which types of file formats are the best choice for files that may need to be edited later?
    14·1 answer
  • How is net pay different from gross pay?
    11·1 answer
  • Mr. stevens is the principal of a high school. why might he want to export data from a database of students’ exam scores? to cre
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!