Guest User

Untitled

a guest
Jun 25th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. import sys
  2.  
  3. # This code is going to help load a product into different sized containers without going over the total Capacity of a single contaiter and well as the sum of all of the containers.
  4.  
  5. #First you input the total gallons you wish to load. second enter the loading compacity for each container(Pot).
  6.  
  7.  
  8. product = int(input ('Enter Gallons: '))
  9. print( 'Lets get started! You entered', product, 'gals')
  10.  
  11. Pot1 = int(input ('Enter size of first pot: '))
  12. print ('First container', Pot1)
  13.  
  14. Pot2 = int(input ('Enter size of second pot: '))
  15. print ('Second container', Pot2)
  16.  
  17.  
  18. Pot3 = int(input ('Enter size of third pot: '))
  19. print ('Third container', Pot3)
  20.  
  21. Pot4 = int(input ('Enter size of forth pot: '))
  22. print ('Fourth container', Pot4)
  23.  
  24. Pot5 = int(input ('Enter size of last pot: '))
  25. print ('Fifth container', Pot5)
  26.  
  27. Pot= [Pot1,Pot2,Pot3,Pot4,Pot5]
  28.  
  29. #def myfunc(a=4,b=6):
  30. #sum = a + b
  31. #return sum
  32.  
  33. #myfunc()
  34.  
  35. def totalPot():
  36. sum = Pot1+Pot2+Pot3+Pot4+Pot5
  37. return sum
  38. print
  39.  
  40. print ('Total gallons for your trailer is: ', totalPot())
  41.  
  42.  
  43. #if the total of the product exceed the total of what the pots can hold combined.
  44.  
  45. if totalPot() < product:
  46. print ("WARNING! YOU HAVE TOO MUCH PRODUCT FOR YOUR TRAILER!")
  47. sys.exit()
  48. else:
  49. print ("The product will fit in your trailer! One moment while I deposit your product in the pots")
  50.  
  51. # this part ofvthe code is suppose to fill the the pots from the largest to the smallest.
  52.  
  53. if product <= Pot1:
  54. print ("Pot 1 filled")
  55. else:
  56. print ("Complete! Pot 1 filled")
  57. if product<= Pot1+Pot5:
  58. print ("Pot 5 and Pot 1 filled")
  59. else:
  60. print ("Complete! Pot 1 and 5 are filled")
Add Comment
Please, Sign In to add comment