At Westonci.ca, we provide clear, reliable answers to all your questions. Join our vibrant community and get the solutions you need. Join our Q&A platform and connect with professionals ready to provide precise answers to your questions in various areas. Join our Q&A platform to connect with experts dedicated to providing accurate answers to your questions in various fields.
Sagot :
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).
We hope this was helpful. Please come back whenever you need more information or answers to your queries. We hope this was helpful. Please come back whenever you need more information or answers to your queries. Find reliable answers at Westonci.ca. Visit us again for the latest updates and expert advice.