python - How can I multiply all the numbers from a list to display a new list? -
OK, that's really important and I just need someone to help me. I'm very new to the dragon, So there are some things that I can not find around my head.
I am writing a program that tells the user to input the recipe name, people who do this work.
Then, it asks the user for input information about the content. I did this by creating a list, ("ingredient_name, ingredient_quantity, ingredient_unit)" ing = input after ingredient_unit = input ("" Enter the unit of your component: "ingredients.append") shown below ("Show the amount of your constituent:") ("Content" [y / n] ") for all_ingredients =" ".V. (in the content of str (v)) if not (" Y "," yes ") in cont.lower (): Break
The program then displays the created list, however, I will then ask the user to input a new number of people for the recipe I want to be able to han, and then multiply I do not know exactly how to do this, so if someone can explain that it will be very useful to me! Besides, it is unclear whether it is unclear or unclear , I have tried to explain it in the best way. This is the list that was considered for the list. Tulp unpacking is also quite useful.
new_ingredients = [name, quantity * multiplier, unit] name, quantity, for unit in content]
Comments
Post a Comment