Spocoman

02. Summer Outfit

Dec 20th, 2021 (edited)
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.37 KB | None | 0 0
  1. gradus = int(input())
  2. time_of_day = input()
  3. outfit = ''
  4. shoes = ''
  5.  
  6. if time_of_day == 'Morning':
  7.     if gradus >= 10 and gradus <= 18:
  8.         outfit = 'Sweatshirt'
  9.         shoes = 'Sneakers'
  10.     elif gradus > 18 and gradus <= 24:
  11.         outfit = 'Shirt'
  12.         shoes = 'Moccasins'
  13.     else:
  14.         outfit = 'T-Shirt'
  15.         shoes = 'Sandals'
  16. elif time_of_day == 'Afternoon':
  17.     if gradus >= 10 and gradus <= 18:
  18.         outfit = 'Shirt'
  19.         shoes = 'Moccasins'
  20.     elif gradus > 18 and gradus <= 24:
  21.         outfit = 'T-Shirt'
  22.         shoes = 'Sandals'
  23.     else:
  24.         outfit = 'Swim Suit'
  25.         shoes = 'Barefoot'
  26. else:
  27.     outfit = 'Shirt'
  28.     shoes = 'Moccasins'
  29.  
  30. print(f'It\'s {gradus} degrees, get your {outfit} and {shoes}.')
  31.  
  32.  
  33. Второ решение:
  34.  
  35. gradus = int(input())
  36. time_of_day = input()
  37. outfit = 'Shirt'
  38. shoes = 'Moccasins'
  39.  
  40. if time_of_day == 'Morning' or time_of_day == 'Afternoon':
  41.     if gradus >= 10 and gradus <= 18 and time_of_day == 'Morning':
  42.         outfit = 'Sweatshirt'
  43.         shoes = 'Sneakers'
  44.     elif gradus > 24 and time_of_day == 'Morning' or gradus > 18 and gradus <= 24 and time_of_day == 'Afternoon':
  45.         outfit = 'T-Shirt'
  46.         shoes = 'Sandals'
  47.     elif gradus > 24:
  48.         outfit = 'Swim Suit'
  49.         shoes = 'Barefoot'
  50.  
  51. print(f'It\'s {gradus} degrees, get your {outfit} and {shoes}.')
  52.  
Add Comment
Please, Sign In to add comment