Python 3
(This course is given at VUB in the academic year 2020-2021.)
(This course is given at VUB in the academic year 2020-2021.)
Python is an object-oriented high-level programming language created during 1985-1990. In this course, we aim to learn Python 3, released in 2008, from scratch. One needs to only have a basic understanding of computer programming terminologies to start learning this course. By the end of this course, we expect that the students will be able to combine the Python basic and advanced concepts efficiently while developing a program in Python. Depending on the students’ interest and progress, the door can be open to more advanced topics, including multi-threading, networking, and deep-learning frameworks—PyTorch.
This lecture covers the following topics:
Who am I?
Python history and characteristics
What is new in Python 3?
Basic syntax
Variables
What are Python objects?
Mutability & Immutability in Python
Standard data types
Boolean Type: bool
Numbers: int, float, complex
Text Sequence Type: str
Sequence Types: list, tuple, range
Mapping Types: dict
Exercise
The structure of this course is borrowed from https://www.tutorialspoint.com/python3/. However, I have shared some other topics that I have learnt from some other online resources, such as Python documentation, and DataCamp.
This lecture covers the following topics:
The solutions for the exercises given in the first lesson
More on slicing and item assignments
Hashing and hashable objects
Set and frozenset
Control Flows
If-else
Loops
Iterables
Unpacking and enumerating
This lecture covers the following topics:
The solution for the exercise
Comprehensions
Numpy
ndarray
Array creation routines
Array scalar
Data type objects (dtype)
Examples
Array creation
Slicing
Advanced Indexing
This lecture covers the following topics:
Your solution to the first exercise
Numpy
Examples
Copies & Views
Reshape, ndim, arange
Traversing over ndarrays
Broadcasting
Function
Function syntax
Function arguments
Positional argument (required arguments)
Keyword arguments
Default arguments
Variable-length arguments
Python does not support function overloading.
Mutable and immutable parameters
Anonymous functions
Exercise
Classes
Getter and setters
Instance and class variables
This lecture covers the following topics:
The solutions on the exercises given in the Lesson 4
A recap over mutable and immutable objects
Classes
Instance and class variables
Destroying objects (Garbage Collection)
Class destructor
Function types in a class
Alternative constructors
Best practices
This lecture covers the following topics:
Inheritance
What is inheritance?
Constructors and destructors
Method Inheritance
Inheriting a class variable
Inheriting a class of an external library
Restricting access
Property vs. Getters and Setters
Overriding
Overriding built-in functions
Overriding Operators
Side note: string formatting
Interface and Abstract Classes
Polymorphism