This repository contains Python code examples organized into different levels: Beginner, Object-Oriented, Intermediate, and Advanced Python. It's designed to help learners at various stages of Python programming build a strong foundation and tackle more complex topics.
- Folder Structure
- Beginner_Python
- Object_Oriented
- Intermediate_Python
- Advanced_Python
- Prerequisites
- Run Instructions
The repository is divided into the following sections:
- Beginner_Python: Basic Python concepts.
- Object_Oriented: Object-oriented programming examples in Python.
- Intermediate_Python: Intermediate-level concepts such as data structures and functional programming.
- Advanced_Python: Advanced Python topics, including metaclasses and decorators.
This folder contains code covering the basics of Python. Each file covers a specific foundational concept:
- conditions.py: Handling
conditions
andboolean logic
. - data_types.py: Understanding Python
data types
. - for_loops.py: Using
for
loops in Python. - functions.py: Defining and using
functions
. - if_elif_else.py: Implementing
conditional statements
. - iteration.py: Exploring
iteration
concepts in Python. - lists.py: Working with
lists
. - modular.py: Demonstrating
modular programming
. - optional_parameter.py: Using
optional parameters
in functions. - other_methods.py: Additional built-in Python methods.
- read_file.py:
Reading
files in Python. - write_file.py:
Writing
to files in Python. - slice_operator.py: Using
slice
operator with sequences. - string_methods.py: Applying string methods.
- try_except.py: Exception handling using
try
andexcept
. - while_loops.py: Using
while
loops.
The Object_Oriented
folder provides examples related to object-oriented programming in Python:
- creating_classes.py: Creation of
classes
in Python. - example_public_privateclasses.py: Example of
public
andprivate classes
. - inheritance01.py: Demonstrating basic
inheritance
. - inheritance02.py: Further demonstration of
inheritance
. - intro_to_objects.py: Introduction to
objects
in Python. - public_privateclasses.py: A look at
public
andprivate
class members. - staticclass_methods.py: Understanding
static methods
andclass methods
.
This folder contains intermediate Python topics, including functional programming and much more:
- counter.py: Using
Counter
from the collections module. - deque.py: Working with
deque
objects. - filter_functions.py: Using
filter
functions in Python. - lambda_function.py: Working with
lambda
expressions. - map_function.py: Demonstrating the
map
function. - namedTuple.py: Working with
namedtuple
from the collections module. - optional_parameter.py:
Optional parameters
in Python functions. - static_class_methods.py: Further understanding of
static
andclass methods
.
The Advanced_Python
folder covers more advanced topics, including decorators, metaclasses, and more:
- context_managers.py: Understanding and using
context managers
. - decorators.py: Implementing and using
decorators
. - dunder_or_magic_methods.py: Understanding special or
"dunder"
methods in Python. - generators.py: Using
generators
for efficient iteration. - metaclasses01.py: Introduction to
metaclasses
in Python. - metaclasses02.py: Further understanding of
metaclasses
.
- Python 3.9+
- Download the respective .py file
- Go to a terminal of your choice and run
python filename.py