How do I make this flag on line 5/6 run properly? How do I make this script keep running until the flag "-1" is entered, and then print("End of employeeID list")? I've attached pictures of my code, and then the consol running the code so you can see how its running. Here is my code so far: 1. def getBonus(salary, bonusPercentage): 2. bonusAmount = salary * bonusPercentage 3. return bonusAmount 4. employeeID = (input("Please enter employeeID: " )) 5. if (employeeID)==-1: 6. print("End of employeeID list")
How do I make this flag on line 5/6 run properly? How do I make this script keep running until the flag "-1" is entered, and then print("End of employeeID list")?
I've attached pictures of my code, and then the consol running the code so you can see how its running.
Here is my code so far:
1. def getBonus(salary, bonusPercentage):
2. bonusAmount = salary * bonusPercentage
3. return bonusAmount
4. employeeID = (input("Please enter employeeID: " ))
5. if (employeeID)==-1:
6. print("End of employeeID list")
7. salary = float(input("Please enter your salary: "))
8. bonusPercentage = float(input("Please enter bonusPercentage: "))
9. bonusAmount = getBonus(salary, bonusPercentage)
10. print("Bonus amount is " , bonusAmount)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps