im trying to complete a first year python buisness course assignment and my while loop just wont exit, can anyone help?
salespersons = 0
while int(salespersons) != -1:
sales = float(input("Please enter the salesperson's monthly sales: "))
advance_pay = float(input("Please enter the salesperson's advance pay: "))
data = commision_table(sales,commisionTable)
commision = sales * data[1]
pay = commision - data[0] - advance_pay
print("The Monthly pay is :", pay)
salespersons = int(input("Are there more salespersons, press any number - If not press -1? "))
salespersons = -1
i tried using booleans and operators but it keeps resetting salespersons to 0, im not sure why. i even tried using break and quit() and the loop just refused to stop working – it kept looping. i also tried casting all the variables including salespersons into int, but it still wont work.
Miriam Hajiyeva is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.