Question: using python Ubuy online shopping wants to calculate the amount required to purchase new products from their online store. Write a python program to solve

using python
Ubuy online shopping wants to calculate the amount required to purchase new products from their online store. Write a python program to solve the above problem using fruitful function with parameters and for loop concept. Inside function do the following: a. Create a function with parameter. (Walletamount as parameter). b. Accept the number of products c. Accept unit price of an item using for loop and calculate the totalAmount. d. Check the totalAmount. If totalAmount is less then or equal to Walletamount, Display a message Transaction Approved otherwise display message Not Approved and return the totalAmount Outside Function do the following: e. Accept Walletamount from the user. f. Pass this Walletamount value to the function. g. Display the value returned by the function. Sample Output: Enter the Total Amount in your wallet: 3000 Enter Number of products required: 3 Enter the unit price of a product: 300 Enter the unit price of a product: 500 Enter the unit price of a product: 600 Transaction Approved The Total Required Amount is: 1400.0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
