eolas/Programming_Languages/Python/BBC_Course_Notes.md

18 lines
670 B
Markdown
Raw Normal View History

2023-02-14 09:16:11 +00:00
# BBC Python Course notes
2023-02-14 15:37:40 +00:00
## Day 2
2023-02-14 09:16:11 +00:00
2023-02-14 15:37:40 +00:00
With lists you have to use copy if you wish to make a new version. You cannot just reassign to a new version. This will still update the original. Since it copies the pointer.
2023-02-14 09:16:11 +00:00
2023-02-14 15:37:40 +00:00
Distinguish functions that will create new list and methods which will modify existing list
2023-02-14 09:16:11 +00:00
2023-02-14 15:37:40 +00:00
Functions: named parameter passing, use for default parameter values
2023-02-14 09:16:11 +00:00
2023-02-14 15:37:40 +00:00
Python does not have constants but has a convention of upper case to mimic constants
2023-02-14 09:16:11 +00:00
2023-02-14 15:37:40 +00:00
More on addresses and pointers in Python
2023-02-14 09:16:11 +00:00
2023-02-14 15:37:40 +00:00
With classes we don't need to use `new` when instantiating an instance of a class.
2023-02-14 09:16:11 +00:00
2023-02-14 15:37:40 +00:00
You do not need to define properties in classes if they exist in the constructor