Spocoman

04. Personal Titles

Dec 19th, 2021 (edited)
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. age = float(input())
  2. gender = input()
  3. if age < 16:
  4.     if gender == 'm':
  5.         print('Master')
  6.     else:
  7.         print('Miss')
  8. else:
  9.     if gender == 'm':
  10.         print('Mr.')
  11.     else:
  12.         print('Ms.')
  13.  
  14.  
  15. Тарикатско решение:)
  16.  
  17. age = float(input())
  18. gender = input()
  19.  
  20. print(("Master" if gender == "m" else "Miss") if age < 16 else ("Mr." if gender == "m" else "Ms."))
  21.  
Add Comment
Please, Sign In to add comment