Coding help required in Python using VS Code

Hi everyone,

I am learning Python and need some help please on how to write the code for my program to do the following:

Customer would like to add item A for $20?: (yes/no user input required here)
Customer would like to add item B for $55?: (yes/no user input required here)
Customer would like to add item C for $10: (yes/no user input required here)
Customer would like to add item D for $5: (yes/no user input required here)

Total cost of items added: $(show the total calculated amount for items that user input a ‘yes’ response for)

Any suggestions would be appreciated.

Hi,

this problem consists of repeating essentially the same block of code once for every item that is listed. For every yes answer, you add the price to the total. Else, you do not. After all items have been considered, you display the total cost that has been tabulated. In a visual, it would look a bit like this:

repeat_block

So, you need to create a variable which will keep a running total. At the end of the script, this variable will be used to display the total in the print statement.

It seems GPT is quite good at this:

OP, what code do you have so far that works pretty close to what you want?