BbJLeB

02. Spaceship

Jun 9th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. # 02. Spaceship
  2.  
  3. import math
  4. width = float(input())
  5. length = float(input())
  6. height = float(input())
  7. averageHeight = float(input())
  8. spaceShipVolume = width * length * height
  9. roomVolume = (averageHeight + 0.40) * 2 * 2
  10. spaceShipPlaces = math.floor(spaceShipVolume / roomVolume)
  11. if spaceShipPlaces >= 3 and spaceShipPlaces <= 10:
  12.     print(f"The spacecraft holds {spaceShipPlaces} astronauts.")
  13. elif spaceShipPlaces < 3:
  14.     print(f"The spacecraft is too small.")
  15. elif spaceShipPlaces > 10:
  16.     print(f"The spacecraft is too big.")
Add Comment
Please, Sign In to add comment