Skip to content

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.

Notifications You must be signed in to change notification settings

Majid460/python_practice_part1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 

Repository files navigation

This repository includes the basic python concepts.

 1.1.1. Variables initialization  
 1.2.1. Variables naming convention  
 1.3.1. Variables printing  
 1.4.1. Variables data types  
 1.5.1. Variables destructuring from Array  
 1.6.1. Multiple named variables  
 1.7.1. Multiple Assignments of Variables  
 1.8.1. Re-assigning the variables  
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
        3.2.1. and Logical AND
        3.2.2. or Logical OR
        3.2.3. not Logical NOT
        3.3.1. 'is' Identity Equals
        3.3.2. 'is not' Identity Not Equals
        3.4.1. 'in' Check if present in sequence
        3.4.2. 'not in' Check if not present in sequence
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

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages