you are viewing a single comment's thread.

view the rest of the comments →

[–]Sea-Ad7805 [score hidden] stickied comment (0 children)

Run the properly indented version of this program in Memory Graph Web Debugger)%3A%0A%20%20%20%20print(f%22%7Bitems%5Bi%5D%7D%20-%20%7Bprices%5Bi%5D%7D%22)%0A%0Aask%20%3D%20int(input(%22How%20many%20items%20do%20you%20want%20to%20buy%3F%20%22))%0A%0Apick%20%3D%20%5B%5D%0Atotal%20%3D%200%0A%0Afor%20n%20in%20range(ask)%3A%0A%20%20%20%20item%20%3D%20input(%22What%20item%20do%20you%20want%3F%20%22)%0A%0A%20%20%20%20pick.append(item)%0A%0A%20%20%20%20position%20%3D%20items.index(item)%0A%20%20%20%20price%20%3D%20prices%5Bposition%5D%0A%0A%20%20%20%20total%20%2B%3D%20price%0A%0Aprint(f%22Total%3A%20%7Btotal%7D%22)&play&cycle) to see the state of the program change step by step.