Skip to content

krishsharma-code/python-daily-practice

Repository files navigation

Python Daily Practice

A structured repository dedicated to tracking my daily progress in Python programming, focusing on automation, logic building, and efficient scripting.

📂 Directory Structure

For better maintainability and clear progression tracking, the repository is organized into day-wise modules:

Core Fundamentals & Conditional Logic

  • Variables & Data Types: Understanding how to store and manipulate data.
  • Input/Output (I/O): Interactive scripting using input() and formatted print().
  • Arithmetic Operations: Basic mathematical computations and logic.
  • Conditionals: Implementing decision-making using if-elif-else statements (e.g., Voting Eligibility, Traffic Light Bot).

Iteration & Mathematical Algorithms

  • Loops & Iteration: Mastering for loops for repetitive tasks and sequence traversal.
  • Math Logic: Implementing classic algorithms such as Factorial calculation, Square numbers, and Multiples.
  • Sequence Manipulation: String iteration and reverse counting.
  • Pattern Generation: Visualizing logic through nested structures (e.g., Star patterns).

Conditional Iteration & Control Flow

  • Basic While Loops: Implementing condition-based iteration.
  • Sentinel Values: Using specific inputs to terminate loops dynamically.
  • Control Statements: Mastering break for early exit and continue for skipping iterations.
  • Loop Else Block: Understanding the while...else structure unique to Python.
  • Logic Building: Applying while loops to math (Factorials) and simple logic games.

Modular Programming & ScopeCOMPLETED

  • Function Basics: Defining and calling reusable blocks of code.
  • Arguments & Parameters: Mastering positional, keyword, and default arguments.
  • Return Values: Handling single and multiple outputs (tuples) from functions.
  • Variable Scope: Understanding Local vs Global namespaces.
  • Advanced Concepts: Anonymous (Lambda) functions and variable-length arguments (*args, **kwargs).
  • Logic Modules: Building function-driven tools like calculators and string processors.

Advanced Sequences & MappingsCOMPLETED

  • Lists & Mutability: mastering dynamic arrays and sequence slicing.
  • Tuples & Sets: Understanding immutability and mathematical set operations (union/intersection).
  • Dictionaries: Deep dive into key-value pairs and nested structures.
  • Comprehensions: Writing "Pythonic" code with list and dictionary comprehensions.
  • Practical Data: Implementing Stacks, Queues, and mock AI datasets.

Modular Programming, File I/O & Robust LogicCOMPLETED

  • Advanced Functions: Deep dive into *args, **kwargs, and nested functions.
  • Anonymous Logic: Mastering lambda, map(), and filter().
  • Scope Management: Handling Local vs Global variables using the global keyword.
  • Error Handling: Implementing try-except-else-finally blocks and custom exceptions.
  • File I/O: Practical application of reading, writing, and appending to .txt files.
  • Robust Systems: Building fault-tolerant calculators and mock data cleaners.

Object-Oriented Programming (OOP) FundamentalsCOMPLETED

  • Classes & Objects: Defining blueprints and instantiating objects.
  • Constructors: Using __init__ for attribute initialization.
  • Methods: Implementing instance methods to manipulate object data.
  • Variable Scope: Understanding Class variables vs Instance variables.
  • Inheritance & Polymorphism: Creating parent/child relationships and method overriding.
  • Encapsulation: Data hiding using private attributes and getter/setter methods.
  • Practical OOP: Building models for Gaming, Networking, and YouTube management.

Advanced Object-Oriented ProgrammingCOMPLETED

  • Magic Methods (Dunder): Mastering __str__, __repr__, __add__, and __eq__ for custom object behavior.
  • Class Methods: Using @classmethod for alternative constructors and class-level logic.
  • Static Methods: Implementing @staticmethod for utility functions that don't require instance state.
  • Property Decorators: Using @property for managed attribute access (Getters, Setters, Deleters).
  • Custom Exceptions: Designing user-defined error classes for robust error handling.
  • Abstract Base Classes (ABC): Enforcing method implementation in child classes using the abc module.
  • Complex Models: Building advanced systems for Inventory Management, YouTube Analytics, and Network Data Packets.

File Handling, OS Module & Data SerializationCOMPLETED

  • File I/O Basics: Mastering open(), read(), write(), and append() modes.
  • Context Managers: Implementing safe file operations using the with statement.
  • OS Module: Navigating directories, listing files, and path management.
  • Data Formats: Parsing and generating CSV and JSON data for configuration and storage.
  • System Utilities: Using shutil for backups and sys.argv for CLI tool development.
  • Practical Tools: Building game save managers, log archivers, and metadata extractors.

Object-Oriented Programming (OOP) FundamentalsCOMPLETED

  • Classes & Objects: Defining blueprints, instantiating objects, and understanding self.
  • Constructors: Using __init__ for attribute initialization.
  • Variable Scope: Mastering Class variables vs Instance variables.
  • Inheritance: Creating parent/child relationships and using super().
  • Polymorphism: Method overriding and unified interfaces.
  • Encapsulation: Data protection using private attributes (_ and __).
  • Magic Methods: Implementing dunder methods like __str__ and __len__.
  • Practical OOP: Building models for Team Management, PC Building, and YouTube Metadata.

Advanced Object-Oriented ProgrammingCOMPLETED

  • Class & Static Methods: Mastering @classmethod and @staticmethod for versatile class design.
  • Property Decorators: Implementing managed attribute access with Getters, Setters, and Deleters.
  • Abstract Base Classes: Enforcing structural contracts in subclasses using the abc module.
  • Multiple Inheritance: Understanding MRO (Method Resolution Order) and multi-parent hierarchies.
  • Custom Exceptions: Designing domain-specific error classes for robust OOP applications.
  • Dataclasses: Leveraging @dataclass for concise and efficient data modeling.
  • Operator Overloading: Implementing dunder methods for custom mathematical object behavior.
  • Design Patterns: Implementing the Singleton pattern for centralized state management.
  • Object Serialization: Using pickle to save and restore complex class instances.

Web Scraping, API Integration & Data AutomationCOMPLETED

  • HTTP Requests: Mastering GET and POST methods using the requests library.
  • HTML Parsing: Using BeautifulSoup to navigate and extract data from DOM structures.
  • CSS Selectors: Implementing advanced .select() queries for precise data extraction.
  • REST APIs: Fetching and parsing JSON data from live endpoints (e.g., PokeAPI).
  • Data Serialization: Automating mock data generation and exporting to JSON and CSV formats.
  • Browser Automation: Basic setup and interaction using Selenium for dynamic web tasks.
  • Robust Scraping: Implementing error handling, timeouts, and status code verification.

🚀 How to Run

Navigate to the specific day's directory and execute the script using Python 3:

cd Day_01_and_02_Basics
python 01_hello_world.py

🔒 License

This repository is for educational purposes. Feel free to explore and use the scripts for learning.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages