This repository has been archived on 2025-12-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2024-09-20 14:17:13 +03:00

24 lines
514 B
Plaintext

import matplotlib.pyplot as plt
dct = {}
def info():
while len(dct) <= 4:
name = input('Name: ')
try:
score = float(input('Score: '))
dct[name] = score
except Exception:
print('Please enter a number.')
info()
return
namel = list(dct.keys())
scorel = list(dct.values())
plt.xticks(range(len(scorel)), namel)
plt.title('People and their scores')
plt.bar(range(len(scorel)), scorel)
plt.show()
info()