Dec-21-2017, 12:34 PM
def b(): salmin = int(input("Enter the minimum salary: ")) salmax = int(input("Enter the maximum salary: ")) for employee in employees: if salmin <= int(employee[1]) <= salmax: if len(i)==5: print('%-30s' % (employee[4]+ ','+' '+employee[3]), '%30s' % employee[0], '%30s' % employee[1], '%30s' % employee[2]) if len(i)==6: print('%-30s' % (employee[5]+','+' '+employee[3]+' '+employee[4]), '%30s' % employee[0], '%30s' % employee[1], '%30s' % employee[2]) if len(i)==7: print('%-30s' % (employee[6]+','+' '+employee[3]+' '+employee[4]+' '+employee[5]), '%30s' % employee[0], '%30s' % employee[1], '%30s' % employee[2]) return employee else: print("There are no employees within that salary range")I've changed variable and it's being weird again.
Output:Select an option from 1 - 3 (0 to quit): 2
Enter the minimum salary: 10000
Enter the maximum salary: 30000
Flanders, Ned 12346 25000 Teacher
Select an option from 1 - 3 (0 to quit): 2
Enter the minimum salary: 50
Enter the maximum salary: 50000
Flanders, Ned 12346 25000 Teacher