Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Learning Files

This repository contains the Python examples I created while learning Python. The files below are arranged in a suggested learning order, from beginner fundamentals to more advanced topics.

Click any lesson title to open its Python file directly.

How to use this repository

  1. Start with Section 1: Getting Started.
  2. Open each linked file, read the comments, and try to predict its output.
  3. Run a file with python3 "filename.py".
  4. Change the examples and run them again.
  5. Complete the small projects after learning the related concepts.

Note

Some original filenames contain spaces or spelling mistakes. Their display names are corrected below, while the files themselves are unchanged so existing imports continue to work.

1. Getting Started

  1. First Python Program — program structure and the __main__ check
  2. Variables — storing strings, numbers, and Boolean values
  3. Multiple Assignment — assigning several variables at once
  4. Type Casting — converting between data types
  5. User Input — reading values from the keyboard
  6. Math Functions — common operations from the math module
  7. String Methods — inspecting and changing strings
  8. String Formatting — formatting text and numbers

2. Strings and Operators

  1. Index Operator — accessing characters by position
  2. String Slicing — extracting parts of strings
  3. Nested Function Calls — using one result inside another call
  4. Logical Operators — using and, or, and not
  5. Walrus Operator — assignment expressions with :=

3. Conditions and Loops

  1. If Statements — conditional execution
  2. While Loops — repeating while a condition is true
  3. For Loops — iterating a fixed number of times
  4. Nested Loops — using a loop inside another loop
  5. Loop Control Statementsbreak, continue, and pass

4. Collections

  1. Lists — ordered, changeable collections
  2. Two-Dimensional Lists — lists containing other lists
  3. Tuples — ordered, unchangeable collections
  4. Sets — unique, unordered values
  5. Dictionaries — key-value pairs and nested dictionaries
  6. Sortingsort() and sorted()
  7. Zip Function — combining multiple iterables
  8. List Comprehensions — concise list creation
  9. Dictionary Comprehensions — concise dictionary creation

5. Functions

  1. Functions — defining and calling functions
  2. Return Statements — returning values from functions
  3. Keyword Arguments — passing arguments by name
  4. *args — accepting a variable number of positional arguments
  5. **kwargs — accepting a variable number of keyword arguments
  6. Variable Scope — local, enclosing, global, and built-in scope
  7. Functions Assigned to Variables — treating functions as objects
  8. Higher-Order Functions — passing or returning functions
  9. Lambda Functions — small anonymous functions
  10. map() — transforming iterable items
  11. filter() — selecting iterable items
  12. reduce() — reducing an iterable to one value

6. Modules and Program Structure

  1. Creating a Module — reusable functions for importing
  2. Using Modules — different import styles
  3. __name__ and __main__ — running versus importing a module
  4. __name__ Companion Example — observing the module name
  5. Random Module — random numbers, choices, and shuffling
  6. Time Module — timestamps and time formatting

7. Object-Oriented Programming

  1. Defining a Class — a reusable Car class
  2. Creating and Using Objects — importing and instantiating the Car class
  3. Person Class Example — instance attributes and methods
  4. Class Variables — class and instance variables
  5. Using Class Variables — shared values across objects
  6. Objects as Arguments — passing objects to functions
  7. Inheritance — parent and child classes
  8. Multilevel Inheritance — inheritance across several levels
  9. Multiple Inheritance — inheriting from multiple parents
  10. Method Overriding — replacing inherited behavior
  11. super() — calling a parent implementation
  12. Method Chaining — calling methods sequentially
  13. Duck Typing — using behavior instead of strict types
  14. Abstract Classes — defining required methods with abc
  15. OOP and SOLID Practice — encapsulation, inheritance, abstraction, polymorphism, duck typing, and composition in one example

8. Errors and File Handling

  1. Exception Handlingtry, except, else, and finally
  2. Detecting Files and Directories — checking paths with os.path
  3. Reading a File — reading text with a context manager
  4. Writing a File — writing text with a context manager
  5. Copying a File — copying with shutil
  6. Moving a File — moving with os.replace
  7. Deleting Files and Directories — removing filesystem content

Caution

Review the paths before running the move or delete examples. They can change or remove files. Some path examples were written for Windows and need to be changed before use on Linux.

9. Concurrency

  1. Multithreading — running multiple I/O-style tasks concurrently

10. Beginner Projects and Practice

  1. Quiz Game — functions, dictionaries, loops, input, and scoring
  2. Rock Paper Scissors — loops, conditions, input, and randomness
  3. General Practice — assorted exercises and experiments

Recommended learning path

The main progression is:

BasicsStringsConditions and loopsCollectionsFunctionsModulesOOPExceptions and filesMultithreadingProjects

Do not worry about memorizing everything. Type the examples yourself, experiment with them, and return to earlier lessons whenever a later topic feels unclear.

About

A collection of Python files documenting my learning path and progress in mastering Python programming. This repository includes code snippets, practice exercises, and notes on key concepts, libraries, and frameworks, aimed at enhancing my understanding and proficiency in Python development.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages