https://github.com/bendog/analogies
Weird analogies I've come up with while teaching Python
https://github.com/bendog/analogies
Last synced: 4 months ago
JSON representation
Weird analogies I've come up with while teaching Python
- Host: GitHub
- URL: https://github.com/bendog/analogies
- Owner: bendog
- License: gpl-3.0
- Created: 2020-07-04T01:38:48.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-04T01:49:06.000Z (almost 6 years ago)
- Last Synced: 2025-10-28T03:32:26.540Z (8 months ago)
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Analogies
Weird analogies I've come up with while teaching Python
## Functions are like contractors
**Functions are like contractors, they might do the same task, but once they're done they pack up and leave.**
Like your uber drivers all do the same task, but if you have a good chat to one driver about cats, the next driver wont know what you talked about.
## Functions inherit variables from parents
**Children inherit their parents genes, parents don't inherit the genes of their children.**
A function (child) will know the values of the variables set in the main (global/parent) part of your script, but the variables set in the function (child) will only be known to the function (child).