• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

I need help implementing a for loop and a parameter

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

 
Marshal
Posts: 72926
330
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
jennifer cho
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

It is indeed in Python. Here is the full code:

 
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Thank you,
Palaparthi NBB Anirudh.

 
I found some pretty shells, some sea glass and this lovely tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic