Question: ( Phyton problem ) num _ soups and total _ allowance are read from input. A soup costs 7 dollars. If num _ soups is
Phyton problem numsoups and totalallowance are read from input. A soup costs dollars.
If numsoups is less than then output 'Not enough soups.
If numsoups is greater than or equal to then assign totalcost with the product of numsoups and
If totalcost is less than or equal to totalallowance, then output 'Successful purchase!
Otherwise, output 'Need more money to purchase all.
If totalallowance is greater than or equal to then output At least one item was purchased.
Click here for examples
Ex : If the input is:
then the output is:
Not enough soups.
Ex : If the input is:
then the output is:
Successful purchase!
At least one item was purchased.
Ex : If the input is:
then the output is:
Need more money to purchase all.
At least one item was purchased.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
