Skip to content

Latest commit

 

History

History

12-Python-Programs

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Python Programs Core Python Beginner Friendly GitHub

🐍 12-Python-Programs

154 Python Programs for Learning, Practice, Revision & Interview Preparation

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.


📖 About

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

🎯 Learning Objectives

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

📊 Programs Covered

# 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


📁 Repository Structure

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.


📚 Learning Coverage

1. Python Basics

  • Introduction to Python
  • Scripting Language
  • Procedural Programming
  • Object-Oriented Programming
  • Basic Python Syntax
  • Program Structure

2. Data Types

  • Integer
  • Float
  • Boolean
  • String
  • Complex
  • Type Identification

3. Type Casting

  • Implicit Type Casting
  • Explicit Type Casting
  • Integer Conversion
  • Float Conversion
  • Boolean Conversion
  • String Conversion
  • Complex Conversion

4. User Input

  • input()
  • Reading User Input
  • Input Conversion
  • Processing User Input

5. Decision Making

  • if
  • if-else
  • if-elif-else
  • Nested Conditions
  • match-case

6. Loops

  • for Loop
  • while Loop
  • range()
  • break
  • continue

7. Basic Programs

  • Calculator Programs
  • Pattern Programs
  • Number Programs
  • Logic-Building Programs

8. Collections

List

  • List Creation
  • Accessing Elements
  • append()
  • extend()
  • insert()
  • Updating Elements
  • remove()
  • pop()
  • clear()
  • del
  • List Slicing
  • List Comprehension

Tuple

  • Tuple Creation
  • Accessing Elements
  • Concatenation
  • Repetition
  • Conversion
  • Removal Concepts
  • Deletion

Set

  • Set Creation
  • add()
  • update()
  • remove()
  • discard()
  • pop()
  • clear()
  • Deletion

Dictionary

  • Dictionary Creation
  • Adding Key-Value Pairs
  • Updating Values
  • Accessing Values
  • pop()
  • popitem()
  • del
  • clear()

9. Functions

  • No Input & No Arguments
  • Input & No Arguments
  • No Input & Arguments
  • Input & Arguments
  • Return Values
  • Lambda Functions
  • Lambda Addition
  • Lambda Subtraction
  • map()
  • Decorators

10. Strings

  • String Creation
  • String Methods
  • String Splitting
  • String Indexing
  • String Slicing
  • Palindrome
  • Character Counting

11. Operators

Arithmetic Operators

  • +
  • -
  • *
  • /
  • %
  • //
  • **

Assignment Operators

  • =
  • +=
  • -=
  • *=
  • /=

Comparison Operators

  • ==
  • !=
  • >
  • <
  • >=
  • <=

Logical Operators

  • and
  • or
  • not

Identity Operators

  • is
  • is not

Membership Operators

  • in
  • not in

Bitwise Operators

  • &
  • |
  • ^
  • ~
  • <<
  • >>

12. Object-Oriented Programming

  • Classes
  • Objects
  • Constructors
  • Static Variables
  • Constructor Overloading
  • Method Overloading
  • Encapsulation
  • Inheritance
  • Constructor Chaining
  • Method Chaining
  • Polymorphism
  • Duck Typing
  • Abstraction
  • Access Specifiers
  • Magic / Dunder Methods

13. Exception Handling

  • Exception Handling
  • try
  • except
  • Single Exception
  • Multiple Exceptions
  • User-Defined Exceptions
  • Exception Handler Classes

14. Modules

  • Modules
  • Creating Modules
  • Importing Modules
  • Module Aliasing
  • import
  • from ... import ...

15. Functional Programming

  • Lambda Functions
  • map()
  • Decorators
  • List Comprehension
  • Functional Programming Concepts

✨ Features

  • ✅ 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

🛠️ Technologies Used

Technology Purpose
Python 3.x Programming Language
Git Version Control
GitHub Repository Hosting
VS Code / PyCharm Development Environment

📋 Prerequisites

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

🚀 How to Run

1. Clone the Repository

git clone <repository-url>

2. Navigate to the Directory

cd 12-Python-Programs

3. Run a Python Program

python 001-Introduction-Program.py

You can replace the filename with any program you want to execute.


🎓 Recommended Learning Approach

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

Practice Method

  1. Read the concept.
  2. Understand the program.
  3. Run the program.
  4. Observe the output.
  5. Modify the code.
  6. Try different inputs.
  7. Rewrite the program independently.
  8. Create your own example.

Don't just read the code — run it, modify it, and practice it.


👨‍💻 Who Is This For?

This repository is suitable for:

  • Python Beginners
  • Students
  • College Students
  • Self-Learners
  • Coding Enthusiasts
  • Aspiring Python Developers
  • Interview Candidates
  • Developers Revising Core Python

⭐ Support

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.


🤝 Contributing

Contributions, suggestions, corrections, and improvements are welcome.

To contribute:

  1. Fork the repository.
  2. Create a new branch.
  3. Make your changes.
  4. Commit your changes.
  5. Push the branch.
  6. Create a Pull Request.

👨‍💻 Author

Shaik Mahaboob Basha

Java Full Stack Developer | Python Full Stack Developer | Software Testing


📜 License

This repository is created for educational and learning purposes.


🐍 Learn Python • Practice Python • Master Python

Happy Learning & Keep Coding! 🚀