Skip to content

patelsahil2k03/Python-Data-Structures

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Python Data Structures - Learning Repository

Academic Project | Computer Engineering | CHARUSAT
Course: Python Programming (Jan 2022)
Student: Sahil Patel (20CE101)
Focus: Fundamental Python concepts and Data Structures

Python Learning


📚 Repository Overview

This repository contains practical assignments and exercises covering fundamental Python data structures and programming concepts. Created as part of academic coursework to demonstrate understanding of:

  • Lists - Dynamic arrays and operations
  • Tuples - Immutable sequences
  • Sets - Unordered collections with unique elements
  • Dictionaries - Key-value pair mappings
  • Problem Solving - HackerRank and CodeChef challenges

🎯 Learning Objectives

Core Concepts Covered:

  1. Data Structure Operations - CRUD operations on all structures
  2. Built-in Functions - len(), max(), min(), sum(), etc.
  3. Type Conversions - Converting between data structures
  4. Set Operations - Union, intersection, difference
  5. Dictionary Manipulation - Merging, updating, accessing
  6. Tuple Immutability - Understanding immutable sequences
  7. Problem Solving - Applying concepts to real problems

📂 Repository Structure

Python-Data-Structures/
├── Python practical assignment/    # All practice programs
│   ├── pythonprac_tupledatastruct.py        # Tuple operations (68 lines)
│   ├── pythonprac_setdatastruct.py          # Set operations (109 lines)
│   ├── pythonprac_dictionarydatastruct.py   # Dictionary operations (66 lines)
│   ├── pipprogassignprac1.py                # Character frequency counter
│   ├── pipprogassignprac2.py                # String problems
│   ├── pipprogassignprac3.py                # Numeric operations
│   ├── pipprogassignprac4.py                # List operations
│   ├── pipprogassignprac5.py                # Advanced list problems
│   ├── pipprogassignprac8.py                # Exception handling
│   ├── pipprogassignprac9.py                # OOP concepts
│   ├── pipprac5.py                          # Container water problem
│   ├── pipprac6.py                          # Unique numbers sum
│   └── pipprac7.py                          # Rectangle coordinates
├── main.py                                   # PyCharm template
├── README.md                                 # This file
├── .gitignore                                # Git ignore patterns
└── LICENSE                                   # MIT License

Total: 13 Python programs | 525+ lines of code


🚀 Getting Started

Prerequisites

  • Python 3.x installed
  • Basic understanding of programming concepts
  • Text editor or IDE (PyCharm, VS Code, etc.)

Installation

# Clone the repository
git clone https://github.com/patelsahil2k03/Python-Data-Structures.git

# Navigate to directory
cd Python-Data-Structures

# Navigate to assignments folder
cd "Python practical assignment"

# Run any program
python3 pythonprac_tupledatastruct.py

📝 Program Descriptions

Data Structure Programs

1. pythonprac_tupledatastruct.py

Topics:

  • Creating tuples with different data types
  • Tuple indexing and slicing
  • Adding items to tuples
  • Converting tuple to string
  • Finding tuple length

Sample Code:

# Create tuple with mixed datatypes
my_tuple = (1, "Hello", 3.4)

# Add items to tuple
intTuple = intTuple + (70,)

# Convert to string
str = ''.join(tup)

2. pythonprac_setdatastruct.py

Topics:

  • Adding/removing set members
  • Set operations (union, intersection, difference)
  • Finding max/min in sets
  • Common elements across data structures

Sample Code:

# Set operations
A = {0, 2, 4, 6, 8, 10}
B = {1, 2, 3, 4, 5, 6}

print("Union:", A | B)
print("Intersection:", A & B)
print("Difference:", A - B)

3. pythonprac_dictionarydatastruct.py

Topics:

  • Checking key existence
  • Merging dictionaries
  • Summing dictionary values
  • Adding/updating keys
  • Dictionary concatenation

Sample Code:

# Check if key exists
def is_key_present(x):
    if x in d:
        return True
    return False

# Merge dictionaries
d1.update(d2)

# Sum all values
sum(dic.values())

Problem Solving Programs

4. pipprogassignprac1.py - Character Frequency Counter

Calculate frequency of each character in a string.

Algorithm: Dictionary-based counting


5. pipprac5.py - Container Water Problem

Calculate maximum water a container can store.

Concept: Array manipulation, optimization


6. pipprac6.py - Unique Numbers Sum

Count unique numbers whose sum equals K.

Concept: Set operations, mathematical logic


7. pipprac7.py - Rectangle Coordinates

Change rectangle coordinates from (x, y) to (dx, dy).

Concept: Coordinate geometry, transformations


8. pipprogassignprac8.py - Exception Handling

Different types of exceptions in Python.

Topics: try-except, error handling


9. pipprogassignprac9.py - OOP Concepts

Method overriding in derived classes.

Topics: Inheritance, polymorphism


💡 Key Learnings

Python Fundamentals:

  • Data Structures - Mastered List, Tuple, Set, Dictionary
  • Built-in Functions - Effective use of Python builtins
  • Type Conversions - Flexible data structure transformations
  • Problem Decomposition - Breaking complex problems into steps

Programming Skills:

  • Code Organization - Structuring programs logically
  • Documentation - Adding comments and explanations
  • Testing - Verifying outputs with test cases
  • Debugging - Identifying and fixing errors

🎓 Academic Context

Course: Python Programming Practical
Semester: 2nd Semester (Jan-Apr 2022)
Institution: CHARUSAT - CSPIT
Program: B.Tech Computer Engineering
Student ID: 20CE101

Purpose: Academic assignments to demonstrate understanding of Python fundamentals and data structures as part of Computer Engineering curriculum.


🚀 From Basics to Production (2022 → 2026)

This repository represents foundational Python learning from 2022.

Journey Since Then:

  • 📊 Built ML models with 98%+ accuracy using advanced Python
  • 🚀 Deployed production systems serving 2M+ users
  • 🤖 Mastered LangChain, TensorFlow, PyTorch
  • ☁️ Developed AWS Lambda functions in Python
  • 📚 Published 2 SCOPUS-indexed research papers
  • 💼 Associate Software Engineer at Digiflux Technologies

Current Skillset: Python, JavaScript/TypeScript, AI/ML, Cloud, Full Stack
Portfolio: patelsahil2k03.github.io


📖 How to Use This Repository

For Learning:

  1. Start with basics - pythonprac_tupledatastruct.py
  2. Progress systematically - sets → dictionaries
  3. Practice problems - pipprogassignprac*.py files
  4. Experiment - Modify code, add features
  5. Understand concepts - Read comments, trace execution

For Reference:

  • Quick syntax lookup for data structures
  • Example implementations of common operations
  • Problem-solving patterns
  • Academic assignment structure

🔧 Running Programs

# Run tuple examples
python3 pythonprac_tupledatastruct.py

# Run set operations
python3 pythonprac_setdatastruct.py

# Run dictionary programs
python3 pythonprac_dictionarydatastruct.py

# Run problem-solving programs
python3 pipprogassignprac1.py

Expected Output: Each program prints results demonstrating the concept with test cases.


📊 Repository Statistics

  • Total Programs: 13
  • Total Lines: 525+
  • Data Structures: 4 (List, Tuple, Set, Dictionary)
  • Concepts Covered: 20+
  • Problems Solved: 10+

🤝 Contributing

This is an academic learning repository. While direct contributions aren't expected, feedback and suggestions are welcome!

If you're a student learning Python:

  • Feel free to fork and practice
  • Add your own solutions
  • Compare approaches
  • Learn collaboratively

📜 License

MIT License - See LICENSE file for details.

Free to use for educational purposes.


📧 Contact

Sahil Patel
Email: patelsahil2k03@gmail.com
Portfolio: patelsahil2k03.github.io
GitHub: @patelsahil2k03
LinkedIn: sahil-patel-581226205


🌟 Acknowledgments

  • CHARUSAT CSPIT - For excellent Python programming curriculum
  • Course Instructors - For guidance and assignments
  • Python Community - For comprehensive documentation

This repository documents the beginning of my Python journey - from basics to building production AI/ML systems.
Last Updated: March 2026

About

This Repository covers few basic concepts of List, Tuple, Dictionary, and Set through Python commands.

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages