Python Course – 5. Functions
Learn Python functions: arguments and parameters, scope, documenting your code and lambda functions, with theory, videos and a hands-on ATM exercise.
Code
Inside articles there are more settings: width, font size, series position and code.
Saved in this browser.
Learn Python functions: arguments and parameters, scope, documenting your code and lambda functions, with theory, videos and a hands-on ATM exercise.
Learn how to use and create Python packages and modules, install third-party libraries with PIP, and work with Random, Math and Datetime, with exercises.
Learn how Python exceptions work: how to catch them, which ones to handle and which to let through, with video lessons, theory and hands-on exercises.
Learn how to work with files and directories in Python: paths, reading and writing files, plus practical exercises with video lessons and downloadable theory.
Python generators let you stream data in real time and get each item only when it's consumed. A great balance between processing and memory. Learn them here.
Return in Python means "we're done". Functions with: Return and one value, Return and several values, Return None, Return void, No Return, and more.
Learn how to build your own dictionary-like classes in Python with Mapping and MutableMapping: magic methods, lifecycle, repr, str and a full working example.
Mapping, Sequence or Collection in Python: you choose the best one for the data structure you want to build. A simple explanation of everything you need.
keys(), values() and items() return views, not lists: they stay in sync with the dictionary, key views behave like sets, and you can turn them into lists.
Understand repr vs str in Python and learn how to use them in any custom class. Examples of using repr for debugging.
What makes a Python object hashable, why lists aren't, how hash(), __hash__ and __eq__ work together, and how to make your own class hashable.
Learn whether a variable can change (mutable) or not (immutable). Mutable: List, Dict, Set. Immutable: String, Int, Float, Bool, Tuple, Range, Decimal.