Fairly new to coding and having some confusion with my homework. I want to have the printed results only go to two decimal places and not any farther. I have been messing around with some format options and trying to find the answer online but couldn't understand what I needed to do, any help is much appreciated, thanks!
#Ingredients per 48 cookies
sugar = 1.5
butter = 1
flour = 2.75
#what percent of 48 are the ingredients
sugar1 = (1.5/48)
butter1 = (1/48)
flour1 = (2.75/48)
#ask for amount of cookies from user
cookies = int (input('How many cookies would you like to bake? '))
#calculate ingredient amounts
sugar2 = (sugar1 * cookies)
format(sugar2, '.2f')
butter2 = (butter1 * cookies)
format(butter2, '.2f')
flour2 = (flour1 * cookies)
format(flour2, '.2f')
print ('To make', cookies, ' you need', sugar2, 'cups of sugar,',
butter2, 'cups of butter, and', flour2, ' cups of flour.')