I'm working on my first non-revisable (after being turned in) task for my programming class.
In this task, I take a list of employees' names, level (for commission), hours worked, and sales generated.
I then output what the combined sales and commission and hourly pay (plus OT), as well as each individual salesperson's name followed by their own commission and wage total (including OT)
I have already made two functions for determining commission rate and hourly rates.
I should mention that we haven't covered dictionary use yet. In doing some reading I've seen that usually when multiple lists and I think nested lists are involved, dictionaries are advisable. Since we haven't covered that, Idk if I should use them. I believe my instructor wants us to only use that which we've been taught. This wasn't explicitly stated though.
EDITED How do I keep the "for x in range(num_employees) from being counted if incorrect level is supplied?
num_employees = int(input("Enter number of salespersons to be evaluated: "))
employee_records = []
wage = None
lrange = [1, 2, 3, 4]
for x in range(num_employees):
record = []
name = (input("Enter employee name: "))
try:
level = int(input("Enter this employee's level: "))
except ValueError:
print("Employee level must be from 1 to 4.")
num_employees += 1
continue
try:
hours = float(input("Enter hours worked by this employee: "))
except ValueError:
print("Entry must be a number.")
num_employees += 1
continue
try:
sales = float(input("Enter revenue generated by this employee: "))
except ValueError:
print("Entry must be a number.")
num_employees += 1
continue
record.append(name)
record.append(level)
record.append(hours)
record.append(sales)
employee_records.append(record)
print(employee_records)