Advertisement
Guest User

Untitled

a guest
May 25th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. # To Do
  2.  
  3. # Ask user for servings made by recipe (and check this is a number that is more than 0
  4. # Ask user for servings desired (check this is a number)
  5. # Calculate the scale factor
  6. # Warn the user if the sf is less than 0.25 or more than 4
  7.  
  8. # Functions go here
  9.  
  10.  
  11.  
  12. # Main Routine goes here
  13.  
  14. serving_size = float(input("What is the recipe serving size? "))
  15. desired_size = float(input("How many servings are needed? "))
  16.  
  17. scale_factor = desired_size / serving_size
  18.  
  19. print("Scale Factor: {}".format(scale_factor))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement