7 Creating functions: Get the order and print it
In this chapter
- Erik creates the actual functions to get and print orders
- Erik uses a dictionary to store and print a customer’s order
- Erik’s program now works as planned!
- Erik and Simon plan to write a function to save orders
“Yesterday, we created the main menu, right?” Simon began his conversation with Erik. “We even tested the main menu’s functionality.”
“Yes, but it didn’t do anything useful,” Erik said.
“Right!” Simon said. “Remember, we talked about the ‘top-down’ approach? We created empty functions just to test the main menu. Now it’s time to make them do something real. Open your Python file where we created menus from files. It’s called menu_files.py
.”
Erik opened that file, and now ...
Get A Pythonic Adventure now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.