Dec-05-2017, 11:47 AM
Your program is comparing floating point numbers as strings.
e.g.:
EID1APro and proavg1 are strings.
e.g.:
if EID1APro >= proavg1:
EID1APro and proavg1 are strings.
'9.00%' >= '10.00%'
Output:True
Normally you put code like this into functions:def invoices_per_employee(employees, total_invoices): avg_processed = np.mean(list(employees.values())) avg_total = avg_processed / total_invoices * 100 for name, processes_invoices in employees.items(): processed = processes_invoices / total_invoices * 100 yield name, avg_processed, avg_total, processes_invoices, processed, processed > avg_total emp = {'David': 170, 'Lisa': 50} total = 1700 list(invoices_per_employee(emp, total))Think about better variable names.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!