That's expensive tea.
Welcome to the Ranch
Which language is that? It isn't Java®. Maybe it's Python, so I shall try moving you to that forum. I shall also add code tags to your post, which you should always use, and you can see how much better it looks. The code tags make the indentation more obvious, which is syntactically significant in Python.
You didn't say what problems you are suffering. We can only help if we know the full details.
I am still a beginner so I need help. I just need help on implementing a for loop in the def cashier() part and a parameter also in the def cashier (). But I do not know how to or how I can change the rest of my code to implement those two things. This is an assignment for school so it is required to have those two things. If you could help me, it would be greatly appreciated because I am really struggling as we have not done any kind of coding before. Can you also explain each step if you alter anything because I need to understand what is going on.
Hello, please find the below code. I hope this suffices your requirements.
Firstly, a parameter for the cashier function is created for the inventory list and the list was passed where ever this code has been called.
Secondly, a for loop has been created inside the cashier function for printing the menu.
Palaparthi NBB Anirudh.
I found some pretty shells, some sea glass and this lovely tiny ad: