ccsf-math-108 / materials-fa23

Fall 2023 student course materials for MATH 108 Foundations of Data Science at CCSF
Creative Commons Zero v1.0 Universal
0 stars 0 forks source link

Lecture 11: Scope Demo: "new_variable" & "new_varaible" name confusion (Moderate) #14

Closed asheynis closed 11 months ago

asheynis commented 12 months ago

In the Scope demo of Lecture 11, we define a function "a_function" and return a value stored in the variable "new_variable". However, in the following two blocks of execution to showcase name errors that result in scope, another variable "new_varaible" (the letters 'a' and 'i' are swapped) is executed leading to a name error. However, this name error does not address the scope aspect, but rather the usual one we learned before that Python does not know what to do with variables that are not defined/assigned anywhere at all. I made the fix on my local end to verify that one still gets a name error showcasing the scope situation to confirm that the intended point of that lesson was still made.

shawnwiggins commented 11 months ago

Good catch, @asheynis! I'll update that for anyone looking at the lecture notebook after this point.

Steps

asheynis commented 11 months ago

You're very welcome! I saw after I submitted the ticket that you made the in-recording correction in a couple of places, but locally on your end, but I wasn't sure if students watching it would have understood the distinction for the cause of the name error so I thought it was worth flagging. See you tomorrow!

On Wed, Sep 27, 2023 at 9:10 AM Shawn Wiggins @.***> wrote:

Good catch, @asheynis https://github.com/asheynis! I'll update that for anyone looking at the lecture notebook after this point. Steps

  • Update spelling
  • Add a note in the lecture video

— Reply to this email directly, view it on GitHub https://github.com/ccsf-math-108/materials-fa23/issues/14#issuecomment-1737696068, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNU5LYWCLVKATB466SBU33X4RFXJANCNFSM6AAAAAA5IOM6CM . You are receiving this because you were mentioned.Message ID: @.***>