A structured collection of 154 beginner-friendly Python programs covering Core Python concepts from fundamental syntax and data types to Object-Oriented Programming, exception handling, modules, functional programming, decorators, list comprehension, and list slicing.
12-Python-Programs is a collection of standalone Python programs created for:
- Learning Python from the fundamentals
- Practicing individual programming concepts
- Strengthening programming logic
- Revising Core Python concepts
- Preparing for technical interviews
Each program focuses on a single concept, making it easier to understand Python step by step.
The programs are written using:
- Simple and beginner-friendly syntax
- Clear program structure
- Meaningful comments
- Practical examples
- Easy-to-understand logic
- Professional coding practices
This repository helps learners understand and practice:
- Python Fundamentals
- Data Types
- Type Casting
- User Input
- Conditional Statements
- Loops
- Pattern Programs
- Lists
- Tuples
- Sets
- Dictionaries
- Functions
- Strings
- Operators
- Object-Oriented Programming
- Constructors
- Encapsulation
- Inheritance
- Polymorphism
- Abstraction
- Access Specifiers
- Exception Handling
- Modules
- Lambda Functions
- Functional Programming
- Decorators
- List Comprehension
- List Slicing
- Magic / Dunder Methods
| # | Category | Status |
|---|---|---|
| 01 | Python Basics | ✅ |
| 02 | Data Types | ✅ |
| 03 | Type Casting | ✅ |
| 04 | User Input | ✅ |
| 05 | Decision Making | ✅ |
| 06 | Loops | ✅ |
| 07 | Basic Programs | ✅ |
| 08 | Collections | ✅ |
| 09 | Functions | ✅ |
| 10 | Strings | ✅ |
| 11 | Operators | ✅ |
| 12 | Object-Oriented Programming | ✅ |
| 13 | Exception Handling | ✅ |
| 14 | Modules | ✅ |
| 15 | Functional Programming | ✅ |
Total Programs: 154
12-Python-Programs/
│
├── 001-Introduction-Program.py
├── 002-Scripting-Language-Example.py
├── 003-Procedural-Style-Example.py
├── ...
├── 152-Decorators.py
├── 153-List-Comprehension.py
├── 154-List-Slicing.py
│
└── README.md
Each .py file is an independent program focused on a specific Python concept.
- Introduction to Python
- Scripting Language
- Procedural Programming
- Object-Oriented Programming
- Basic Python Syntax
- Program Structure
- Integer
- Float
- Boolean
- String
- Complex
- Type Identification
- Implicit Type Casting
- Explicit Type Casting
- Integer Conversion
- Float Conversion
- Boolean Conversion
- String Conversion
- Complex Conversion
input()- Reading User Input
- Input Conversion
- Processing User Input
ifif-elseif-elif-else- Nested Conditions
match-case
forLoopwhileLooprange()breakcontinue
- Calculator Programs
- Pattern Programs
- Number Programs
- Logic-Building Programs
- List Creation
- Accessing Elements
append()extend()insert()- Updating Elements
remove()pop()clear()del- List Slicing
- List Comprehension
- Tuple Creation
- Accessing Elements
- Concatenation
- Repetition
- Conversion
- Removal Concepts
- Deletion
- Set Creation
add()update()remove()discard()pop()clear()- Deletion
- Dictionary Creation
- Adding Key-Value Pairs
- Updating Values
- Accessing Values
pop()popitem()delclear()
- No Input & No Arguments
- Input & No Arguments
- No Input & Arguments
- Input & Arguments
- Return Values
- Lambda Functions
- Lambda Addition
- Lambda Subtraction
map()- Decorators
- String Creation
- String Methods
- String Splitting
- String Indexing
- String Slicing
- Palindrome
- Character Counting
+-*/%//**
=+=-=*=/=
==!=><>=<=
andornot
isis not
innot in
&|^~<<>>
- Classes
- Objects
- Constructors
- Static Variables
- Constructor Overloading
- Method Overloading
- Encapsulation
- Inheritance
- Constructor Chaining
- Method Chaining
- Polymorphism
- Duck Typing
- Abstraction
- Access Specifiers
- Magic / Dunder Methods
- Exception Handling
tryexcept- Single Exception
- Multiple Exceptions
- User-Defined Exceptions
- Exception Handler Classes
- Modules
- Creating Modules
- Importing Modules
- Module Aliasing
importfrom ... import ...
- Lambda Functions
map()- Decorators
- List Comprehension
- Functional Programming Concepts
- ✅ 154 standalone Python programs
- ✅ Beginner-friendly examples
- ✅ Concept-focused programs
- ✅ Simple and readable source code
- ✅ Well-commented programs
- ✅ Professional code structure
- ✅ Core Python coverage
- ✅ Useful for revision
- ✅ Useful for interview preparation
- ✅ Suitable for self-learning
- ✅ Progressive learning approach
| Technology | Purpose |
|---|---|
| Python 3.x | Programming Language |
| Git | Version Control |
| GitHub | Repository Hosting |
| VS Code / PyCharm | Development Environment |
Before running the programs, make sure you have:
- Python 3.x installed
- Basic understanding of programming fundamentals
- A Python-compatible IDE or code editor
Recommended editors:
- Visual Studio Code
- PyCharm
- Python IDLE
git clone <repository-url>cd 12-Python-Programspython 001-Introduction-Program.pyYou can replace the filename with any program you want to execute.
For effective learning, follow the programs in sequence.
Python Basics
↓
Data Types
↓
Type Casting
↓
User Input
↓
Decision Making
↓
Loops
↓
Collections
↓
Functions
↓
Strings
↓
Operators
↓
Object-Oriented Programming
↓
Exception Handling
↓
Modules
↓
Functional Programming
- Read the concept.
- Understand the program.
- Run the program.
- Observe the output.
- Modify the code.
- Try different inputs.
- Rewrite the program independently.
- Create your own example.
Don't just read the code — run it, modify it, and practice it.
This repository is suitable for:
- Python Beginners
- Students
- College Students
- Self-Learners
- Coding Enthusiasts
- Aspiring Python Developers
- Interview Candidates
- Developers Revising Core Python
If this repository helps you with learning, practice, revision, or interview preparation, consider giving it a Star ⭐.
If you find it useful, feel free to share it with other Python learners.
Contributions, suggestions, corrections, and improvements are welcome.
To contribute:
- Fork the repository.
- Create a new branch.
- Make your changes.
- Commit your changes.
- Push the branch.
- Create a Pull Request.
Shaik Mahaboob Basha
Java Full Stack Developer | Python Full Stack Developer | Software Testing
This repository is created for educational and learning purposes.