Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def separation():
- print("====================")
- command = input()
- database_salary = {}
- database_age = {}
- database_posistion = {}
- while not command == 'filter base':
- data = command.split(" -> ")
- key = data[0]
- value = data[1]
- if value.isdigit():
- database_age[key] = value
- elif value.replace('.', '', 1).isdigit():
- value = float(value)
- if value % 100 == 0:
- if value % 10 == 0:
- database_age[key] = value
- else:
- database_salary[key] = value
- else:
- database_posistion[key] = value
- command = input()
- filter_base = input()
- if filter_base == 'Position':
- for key, value in database_posistion.items():
- print(f"Name: {key}")
- print(f"Position: {value}")
- separation()
- elif filter_base == "Age":
- for key, value in database_age.items():
- print(f"Name: {key}")
- print(f"Age: {value}")
- separation()
- elif filter_base == "Salary":
- for key, value in database_salary.items():
- print(f"Name: {key}")
- print(f"Salary: {value}")
- separation()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement