我正在为你收集员工工资的班级做作业,我已经被难住了。它不断循环“他们的薪水是多少:”部分所以我怎样才能将它修复到薪水与员工匹配的位置,而不是继续询问薪水是多少?这是我到目前为止所拥有的,请帮助我提供任何提示建议。(我不是要你做我的工作。我只是想要一些提示/建议)
def main():
name = []
salary = []
n = 0
n = int(input("How many employee's will you be entering?: "))
for i in range(n):
name = input("Enter the employees name: ")
empsalary(name,salary)
def empsalary(empname,esalary):
salary = 0
salary = int(input("What is their salary: "))
for i in range(salary):
if salary < 1 or salary > 200000:
salary = int(input("What is their salary: "))
if salary > 0 and salary < 200000:
salary = int(input("What is their salary: "))