Scope and namespaces in Python Problem Solving w/Python Ch 5 Lecture 4

Опубликовано: 15 Октябрь 2024
на канале: DesignCodeDebugRepeat
174
6

Do you want to learn to code? If you're a beginner, you're in the right place! This video is part of an introductory series that will teach you to program in the popular Python programming language. In this video, we learn about scope or name visibility -- how Python resolves a name in a program to its meaning. It's important to understand this concept, or you'll have difficulty writing large-scale programs and understanding the errors that you will inevitably write into your programs if you're unfamiliar with scope. This series of videos is suitable for beginners or experienced programmers who want to learn Python. Let's have some fun learning to program with Python!

You can purchase the book that goes with this video series here, as an ebook:
https://amzn.to/3oiWwOb
Or textbook:
https://www.barnesandnoble.com/w/prob...

You can practice with the globals and functions code from the video here*:
https://codecheck.io/files/2308292315...

You can practice adding a main function to the simplified adventure game from the video here:
https://codecheck.io/files/2308292319...

The github repository with all of the code examples for the book and these videos is here:
https://github.com/ProfessorBurke/Pyt...

If you want to earn credit for learning to code, take an online course at CCRI! These videos are part of the Programming Concepts course:
https://ccri.edu/comp/

The picture of Margaret Hamilton, MIT software engineer, with the Apollo code,
is in the public domain and was retrieved from:
https://upload.wikimedia.org/wikipedi...
You can read more about that here:
https://news.mit.edu/2016/scene-at-mi...

Class diagram image retrieved from:
https://upload.wikimedia.org/wikipedi...
Attribution:
Elena M, Public domain, via Wikimedia Commons

Structure chart retrieved from:
https://upload.wikimedia.org/wikipedi...
Attribution:
Pluke, Public domain, via Wikimedia Commons

*The CodeCheck system courtesy of Cay Horstmann, https://horstmann.com/codecheck/

00:00 Where we've been and where we're going
00:40 Motivation
03:18 What is scope
03:51 What is a name
05:27 What is a namespace
06:20 Namespace rules
12:56 Moving all code into functions