Within ../Modules there is a folder named PythonRepo. This folder houses each of my Python scripts. Each of these scripts is named to reflect the concept it demonstrates -- "hello_world.py" does as it describes, etc.
Below is the order I suggest the basics should be experienced:
-
hello_world.py - Does what it says on the tin: greeting the world.
-
inputs.py - Demonstrates taking basic inputs from a user.
-
calculator.py - Demonstrates basic mathematical equations within Python.
-
functions.py - A brief introduction to functions.
-
f_strings.py - An alternate, concise way to insert variables into 'print' statements.
-
if_statements.py - Provides a basic example of 'if' & 'else' statements.
-
basic translator.py - Should you want to learn how to garble text, this is an example.
-
lists_and_tuples.py - This is a rudimentary example of how lists and tuples work.
-
for_loops.py - Basic iterative 'for' loops.
-
while_loops.py - Basic iterative functions using 'while' loops.
-
guessing_game.py - A concise demonstration of 'if', 'elif' (or 'if-else' statements), and user inputs in action.
-
two_dimensional_lists.py - A basic two-dimensional list, somewhat akin to a basic array.
-
dictionaries.py - Dictionaries, using keys and values.
-
for_while_else.py - Mixing 'for' 'while' loops and 'else' statements.
-
choose_your_own_adventure.py - A basic 'choose your own adventure' game.
-
lambda.py - A simple example of 'lambda' - an anonymous variable declared within an expression.
-
comprehensions.py - Using 'for' loops on the same line as the expression of variables.
-
lists_tuples_sets.py - Using the '.pop()' method on lists; using the 'slice' operator; introducing 'sets'; demonstrating 'enumerate' statements; and a brief introduction to the '.union()' method.
-
sort_by_key.py - Sorting dictionaries using keys, functions, and the '.sort()' method.
-
map_and_filter.py - Mapping values to other values and checking if the result of a function is true using 'lambda'.
-
args_kwargs.py - Using '*args' & '**kwargs' in functions and various expressions.
-
slots.py - A working slot machine, demonstrating various concepts used previously.
Here you will find examples of some useful functions, statements, methods and such that I went out of my way to learn and tinker with. I don't consider any of these
-
-
reading_files.py - Reading files into memory, to be used within the Python environment.
-
writing_appending_files.py - Writing to new files, overwriting and appending data to existing files.
-
-
- handling_exceptions.py - Exception handling using functions, 'except', 'try' and 'finally' statements.
-
-
zipping.py - Zipping lists together using the 'zip()' method.
-
unpacking.py - Unpacking tuples, lists, dictionaries and strings using unpacking.
-
-
- itertools_example.py - An example of how to use the 'itertools' module, which focuses on iterative functions.
-
- password_manager.py - An example of a basic password manager - DO NOT USE THIS TO STORE ANY CREDENTIALS YOU CARE ABOUT.
This is where I provide more detailed examples of concepts requiring more time and effort for me to grasp fully.
Instead of steadily becoming more functionally complex, or starting small, this section will begin with an 'info-dump' of sorts -- consider this a disclaimer.
-
-
oop_dog.py - This goes through the basics of classes, such as the '__init__' dunder method as well as the 'self' parameter.
-
oop_student.py - This demonstrates adding individual objects to multiple classes, interacting with each object's attributes, and some specifics around the types of methods present within classes.
-
oop_inheritance.py - Here is an introduction to the concepts of class inheritance and class attribute priority.
-
class_attributes.py - A brief example of how 'class methods' work; all class methods are methods of a class, but not all methods of a class are class methods.
-
static_methods.py - A very brief introduction to static methods within classes.
-
-
-
Chef:
-
Multi-class import:
-
Multiple-choice:
-