I am working on pay raise of employees with particular ids. Suppose, I have 5 employees in my company. I have shown them in a employee_id_list. I want python to take input from me which consists of the particular ids of the employees, I want to raise the pay, along with their salary. Then, I am creating the dictionary out of these inputs. Now I want to iterate over the employee_id_list such that it matches with of the input ids. If it matches, I want to take the respective value of key which is salary and raise the pay. But I am getting an error.
I have searched for everything present on stackoverflow but nothing matches my problem
employee_id_list = [27, 25, 98, 78, 66]
employee_dict = dict()
while True:
x = input("Enter an key to continue and 'r' for result: ").lower()
if x== 'r':
break
try:
employee_id = int(input("Enter key the Employee id: "))
salary = int(input(f"Enter the {employee_id}'s salary: "))
employee_dict[employee_id] = salary
except ValueError:
print("Please Enter the Integers!")
continue
print(employee_dict)
for e_ids in employee_id_list:
for key, value in employee_dict.items():
if e_ids in employee_dict[key] :
employee_dict[value] = 0.8*value + value
print(employee_dict)
I am getting this error
TypeError: argument of type 'int' is not iterable