Join Barron Stone for an in-depth discussion in this video Add new input parameters, part of Programming Foundations: Real-World Examples.
- The function I use for making an omelette…is very convenient,…but it's also very boring.…Every time I perform that function…I produce the exact same generic omelette.…It's tasty, but I like variety.…So rather than making the same generic omelette every time…I'll modify my function…so I can add a special ingredient to it.…Now, when I decide to make an omelette,…I'll choose an ingredient,…like maybe this plate of bacon,…and I'll use that ingredient as the input…to my omelette-making function.…Let's take a quick look at how we can pass…input ingredients to the make_omelette function in Python.…
I have the start_01_03_breakfast_functions script…open in Idle, which has the mix_and_cook, make_omelette…and make_pancake functions that I've already created.…I'll modify the make_omelette function now…so we can pass input objects directly to it…by adding an input parameter inside of the parenthesis…called ingredients.…This parameter is a variable name that I can use…inside of the make_omelette function…to access the input value being provided by the user.…
- Reusing functions
- Local vs. global variables
- Creating and naming custom objects
- Class inheritance
- Modules and packages
- Multidimensional lists and tuples
- Queues and stacks
- Creating and combining sets
- Storing data in dictionaries
- If/else and switch statements
- For vs. while loops
- Error handling
- Polling and event-driven programming
Skill Level Beginner
Programming Foundations: Design Patterns (2013)with Elisabeth Robson2h 19m Intermediate
3. Class Inheritance
4. Modules and Packages
5. Lists and Tuples
6. Queues and Stacks
9. Conditional Execution
11. Error Handling
12. Polling and Event-Driven Programming
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.