Sichanov

Untitled

Jan 21st, 2021
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. type_of_gas = input(str())
  2. liters = float(input())
  3. type1 = 'diesel'
  4. type2 = 'gasoline'
  5. type3 = 'gas'
  6.  
  7. if type_of_gas == 'Diesel':
  8.     if liters >= 25:
  9.         print(f'You have enough {type1}.')
  10.     else:
  11.         print(f'Fill your tank with {type1}!')
  12.  
  13. elif type_of_gas == 'Gasoline':
  14.     if liters >= 25:
  15.         print(f'You have enough {type2}.')
  16.     else:
  17.         print(f'Fill your tank with {type2}!')
  18.  
  19. elif type_of_gas == 'Gas':
  20.     if liters >= 25:
  21.         print(f'You have enough {type3}.')
  22.     else:
  23.         print(f'Fill your tank with {type3}!')
  24. else:
  25.     print('Invalid fuel!')
Advertisement
Add Comment
Please, Sign In to add comment