psetHere is my code so far:
MEDALS = 3
COUNTRIES = 8
# Create a list of country names.
countries = [ "Canada", "Italy", "Germany", "Japan",
"Kazakhstan", "China",
"South Korea", "United States" ]
# Create a table of medal counts.
counts = [
[ 0, 3, 0 ],
[ 0, 0, 1 ],
[ 0, 0, 1 ],
[ 1, 0, 0 ],
[ 0, 0, 1 ],
[ 3, 1, 1 ],
[ 0, 1, 0 ],
[ 1, 0, 1 ]
]
print(' Country Gold Silver Bronze Total')
for v in countries:
country = v
print("{:>13}".format(country))
for row in range(COUNTRIES):
for col in range(MEDALS):
print(counts[row][col],end = ' ')
print('')
Supposed to solve this without using any imported modules. How can I do this and please explain it to me? thank you so very much.
I can get the numbers to print under the table but not in the columns of the table like it is supposed to be.
zip(countries, counts)
gives you back.