Return vs print: the way it was phrased made it seem like the print statement was similar to the return statement. It’s not, print is just a function basically equivalent to console.log.
Scopes: you actually can modify global variables from a local scope by using the global keyword, like this:
global_var = 1
global_var = 2
local_var = "a"
nonlocal local_var # similar to global for inner functions
local_var = "b"
These are not meant to be comprehensive tutorials that teach everything about a topic, they're my personal notes that I made into posts. But thanks
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.