daily pastebin goal
72%
SHARE
TWEET

Untitled

a guest Jan 17th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. text = input()
  2. Age = {}
  3. Salary = {}
  4. Position = {}
  5.  
  6. while text != 'filter base':
  7.     user_data = text.split(' -> ')
  8.     name = user_data[0]
  9.     age_num = 0
  10.     salary_num = 0
  11.     position_txt = ''
  12.     try:
  13.         float(user_data[1])
  14.         if float(user_data[1]) % 1 == 0:
  15.             age_num = int(float(user_data[1]))
  16.             Age[name] = age_num
  17.         else:
  18.             salary_num = float(user_data[1])
  19.             Salary[name] = salary_num
  20.     except:
  21.         position_txt = user_data[1]
  22.         Position[name] = position_txt
  23.     text = input()
  24.  
  25.  
  26. controller = input()
  27.  
  28. if controller == 'Salary':
  29.     for key, value in Salary.items():
  30.         print(f'Name: {key}')
  31.         print(f'{controller}: {value}')
  32.         print('====================')
  33. elif controller == 'Age':
  34.     for key, value in Age.items():
  35.         print(f'Name: {key}')
  36.         print(f'{controller}: {value}')
  37.         print('====================')
  38. elif controller == 'Position':
  39.     for key, value in Position.items():
  40.         print(f'Name: {key}')
  41.         print(f'{controller}: {value}')
  42.         print('====================')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top