Skip to content

Kapparina/LearningPython

Repository files navigation

My Journey Through Learning Python

The primary purpose of this repository is to document my process of learning Python.

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.

The basics:

Below is the order I suggest the basics should be experienced:

  1. hello_world.py - Does what it says on the tin: greeting the world.

  2. inputs.py - Demonstrates taking basic inputs from a user.

  3. calculator.py - Demonstrates basic mathematical equations within Python.

  4. functions.py - A brief introduction to functions.

  5. exponent_function.py

  6. f_strings.py - An alternate, concise way to insert variables into 'print' statements.

  7. if_statements.py - Provides a basic example of 'if' & 'else' statements.

  8. basic translator.py - Should you want to learn how to garble text, this is an example.

  9. lists_and_tuples.py - This is a rudimentary example of how lists and tuples work.

  10. for_loops.py - Basic iterative 'for' loops.

  11. while_loops.py - Basic iterative functions using 'while' loops.

  12. guessing_game.py - A concise demonstration of 'if', 'elif' (or 'if-else' statements), and user inputs in action.

  13. two_dimensional_lists.py - A basic two-dimensional list, somewhat akin to a basic array.

  14. dictionaries.py - Dictionaries, using keys and values.

  15. for_while_else.py - Mixing 'for' 'while' loops and 'else' statements.

  16. choose_your_own_adventure.py - A basic 'choose your own adventure' game.

  17. lambda.py - A simple example of 'lambda' - an anonymous variable declared within an expression.

  18. comprehensions.py - Using 'for' loops on the same line as the expression of variables.

  19. 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.

  20. sort_by_key.py - Sorting dictionaries using keys, functions, and the '.sort()' method.

  21. map_and_filter.py - Mapping values to other values and checking if the result of a function is true using 'lambda'.

  22. args_kwargs.py - Using '*args' & '**kwargs' in functions and various expressions.

  23. slots.py - A working slot machine, demonstrating various concepts used previously.

More niche concepts & tools:

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

  1. Reading & writing files:
  2. Handling exceptions:
  3. Zipping and unpacking:
    • zipping.py - Zipping lists together using the 'zip()' method.

    • unpacking.py - Unpacking tuples, lists, dictionaries and strings using unpacking.

  4. Itertools:
    • itertools_example.py - An example of how to use the 'itertools' module, which focuses on iterative functions.
  5. Password manager:
    • password_manager.py - An example of a basic password manager - DO NOT USE THIS TO STORE ANY CREDENTIALS YOU CARE ABOUT.

Comprehensive examples:

This is where I provide more detailed examples of concepts requiring more time and effort for me to grasp fully.

Classes & Methods:

Instead of steadily becoming more functionally complex, or starting small, this section will begin with an 'info-dump' of sorts -- consider this a disclaimer.

  1. Single-file examples:
    • 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.

  2. Multi-file examples (grouped accordingly):

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages