This repository is a comprehensive collection of Python programming practice exercises, starting from absolute basics and gradually moving to more advanced topics like 2D arrays (matrices), list comprehensions, and problem-solving with dictionaries.
Python
This repository includes the basic python concepts.
2.1.1. Numbers in Python
2.1.2. Types of Numbers
2.1.3. Basic Arithmetic Operations
2.1.4. Precedence of Operators
2.1.5. Armstrong Number Example
2.1.6. Armstrong Number with List Comprehension
2.1.7. Reverse a Number
2.2.1. What is a String
2.2.2. String Indexing and Slicing
2.2.3. String Reverse with Slice
2.2.4. String Immutability
2.2.5. Re-assigning Whole Strings
2.2.6. Modify String using List and Join
2.2.7. String Formatting (f-string and format())
2.2.8. Looping through a String
2.2.9. Substring Checking (in, not in)
2.2.10. String Comparisons
2.2.11. String Concatenation
2.2.12. Most Common String Methods
2.2.13. Method Examples: capitalize(), casefold(), center(), count(), encode()
2.2.14. Advanced Checks: isdecimal() vs isdigit(), isidentifier(), isprintable()
2.2.15. Join and Strip usage
2.2.16. Character Replacement using translate() and maketrans()
2.3.1. What are Booleans
2.3.2. Boolean Expressions (`==`, `>`, `<`)
2.3.3. `if` Condition with Boolean Result
2.3.4. `bool()` Function Overview
2.3.5. Values that Return `True`
2.3.6. Values that Return `False`
2.3.7. Class Example Returning False via `__len__`
2.4.1. What is Type Casting?
2.4.2. Using `int()`, `float()`, and `str()`
2.4.3. Convert `int` to `str`
2.4.4. Convert `float` to `int`
2.4.5. Convert `str` to `float`
2.4.6. Convert `int` to `float`
3.1.1. = Equal to
3.1.2. += Add and Assign
3.1.3. -= Subtract and Assign
3.1.4. *= Multiply and Assign
3.1.5. /= Divide and Assign
3.1.6. %= Modulus and Assign
3.1.7. //= Floor Divide and Assign
3.1.8. **= Power and Assign
3.1.9. &= Bitwise AND and Assign
3.1.10. |= Bitwise OR and Assign
3.1.11. ^= Bitwise XOR and Assign
3.1.12. >>= Right Shift and Assign
3.1.13. <<= Left Shift and Assign
3.1.14. := Walrus Operator
4.1.1. Converting Collections to Lists
4.1.1.1. From Tuple to List
4.1.1.2. From Set to List
4.1.1.3. From String to List
4.1.2. List Indexing and Slicing
4.1.2.1. Access Items
4.1.2.2. Negative Indexing
4.1.2.3. Range of Indexes
4.1.2.4. Range of Negative Indexes
4.1.3. Creating Lists with Loops
4.1.3.1. Traditional For Loop Method
4.1.3.2. User Input with Loop
4.1.3.3. User Input for Elements
4.1.3.4. List Comprehension (Modern Approach)
4.1.4. Iterating Through Lists
4.1.4.1. Using For Loop with Range
4.1.4.2. Using While Loop
4.1.4.3. Using List Comprehension for Printing
4.1.5. 2D Lists (Matrices)
4.1.5.1. Matrix Creation and Structure
4.1.5.2. Accessing Matrix Elements
4.1.5.3. Matrix Row and Column Access
4.1.5.4. Iterating Through All Matrix Elements
4.1.5.5. Formatted Matrix Output
4.2.1. Count Element Occurrences
4.2.1.1. Dictionary-based Counting
4.2.1.2. List Comprehension Approach
4.2.2. Sum Calculations
4.2.2.1. Sum of All Elements
4.2.2.2. Sum of Elements in Each Row
4.2.2.3. Sum of Elements in Each Column
4.2.3. Element Analysis
4.2.3.1. Find Maximum and Minimum Elements
4.2.3.2. Count Even and Odd Numbers
4.2.3.3. Categorize Even/Odd Elements
4.2.4. Advanced Matrix Operations
4.2.4.1. Matrix Transpose (Nested Loops)
4.2.4.2. Matrix Transpose (List Comprehension)
4.2.4.3. Matrix Transformation Algorithms
4.5.1. Set Basics and Creation
4.5.1.1. Basic Set Creation
4.5.1.2. Set Constructor Method
4.5.1.3. Mixed Data Types in Sets
4.5.2. Set Characteristics
4.5.2.1. No Duplicates Policy
4.5.2.2. Boolean/Numeric Duplicate Handling
4.5.2.3. Set Length and Properties
4.5.3. Accessing Set Elements
4.5.3.1. Iteration Methods
4.5.3.2. Membership Testing
4.5.3.3. No Index Access (Unordered)
4.5.4. Modifying Sets
4.5.4.1. Adding Single Items (add)
4.5.4.2. Adding Multiple Items (update)
4.5.4.3. Adding Any Iterable
4.5.5. Removing Set Elements
4.5.5.1. remove() Method (Error if Not Found)
4.5.5.2. discard() Method (Safe Removal)
4.5.5.3. pop() Method (Random Removal)
4.5.5.4. Deleting Entire Set
4.5.6. Set Operations (Mathematical)
4.5.6.1. Union (Combine All)
4.5.6.2. Intersection (Common Items)
4.5.6.3. Difference (Items in First Set Only)
4.5.6.4. Symmetric Difference (Items NOT in Both)
4.5.7. Set Operators
4.5.7.1. Union Operator (|)
4.5.7.2. Intersection Operator (&)
4.5.7.3. Difference Operator (-)
4.5.7.4. Symmetric Difference Operator (^)
4.7.1. While Loops
4.7.1.1. Basic While Loop Structure
4.7.1.2. Variable Initialization and Increment
4.7.1.3. Infinite Loop Prevention
4.7.2. While Loop Control Statements
4.7.2.1. Break Statement
4.7.2.2. Continue Statement
4.7.2.3. Else Statement with While
4.7.3. For Loops
4.7.3.1. Basic For Loop Structure
4.7.3.2. Iterating Over Sequences
4.7.3.3. String Iteration
4.7.4. Advanced For Loop Techniques
4.7.4.1. Enumerate Function
4.7.4.2. Word and Character Processing
4.7.4.3. Finding Elements and Positions
4.7.5. Nested Loops
4.7.5.1. Basic Nested Loop Structure
4.7.5.2. Matrix and 2D Data Processing