Programs that keeps track of a running total of items the user is purchasing (shopping cart). This will allow the user to keep track of the total so they aren’t embarrassed at the cash register by not having enough $. The program should first ask the user how much $ they have – this is the upper limit of how much they can spend. Then create a loop that asks the user to write in the description of the item, the item price, and the quantity. After an items is entered, print out the detail line (description “Added to cart”, quantity, amount, total) and print the total of the entire bill along with how much money they have remaining. If the user goes over their limit then warn them and tell them to put the last item away.
If multiple quantities pushed them over the top then calculate how many they could buy and tell them that (and adjust it accordingly). For example, the cart total is $80 and they have $90 to spend, they enter “Books” with a value of $4.99 and a quantity of 4 (for an item total of $19.96. This would bring the total bill to $99.96 or $9.96 over the budget. Tell them they you have adjusted the quantity to 2 and they have to put 2 back in order to stay under the budget.
You must use the following somewhere in your code:
• title() # Title function in python is the Python String Method which is used to convert the first character in each word to Uppercase and remaining characters to Lowercase in string and returns new string.
• upper()
• list container with a simple list record structure [ [“item description”, $1.03, 2], [],…].
• lower()
• one of the whitespace strips (rstrip, lstrip, or strip)
• \n or \t
• f-strings
• An integer, a float, and a string
• PLEASE USE MARKDOWN with headings (level-1, level-2, level3) and normal paragraph text.
Make sure to test for invalid entries (things can’t be negative for example) and give the user a way to get out of the program. Make this as user friendly as possible,
Make sure you have appropriate comments in your code.