Join Barron Stone for an in-depth discussion in this video Switch and case statements, part of Programming Foundations: Real-World Examples.
- In addition to the inclusive vegan pizza,…I'm also going to order a pizza for myself.…The pizza company offers a different pizza deal…every day of the week, so I'll make my choice…based on the daily special.…In this scenario, I need to make a decision…based on a single value, the day of the week.…One way I can evaluate this series of options…is as an if-else-if chain…that says if today is Sunday, then order the spinach pizza.…Else, if today is Monday, order the mushroom pizza.…Else, so today is Tuesday, order the pepperoni pizza…and so on.…When my program goes to evaluate the if-else-if chain,…it'll evaluate each of those expressions in order.…
So, let's do that now to pick a pizza.…I'll start at the top of the list and work my way down.…Is it Sunday? No.…Is it Monday? No.…Is it Tuesday? No.…Is it Wednesday? No.…Is it Thursday? No.…Is it Friday? No.…Is it Saturday? Yes!…Today is Saturday, Hawaiian pizza, one of my favorites.…- You know today is Saturday…and it's at the bottom of the list.…Why didn't you start there?…
- 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
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.