Skip to content

keshav-develops/python-notes

 
 

Repository files navigation

python-notes

हिंदी में भी उपलब्ध: README_HI.md

A structured collection of Python lessons and exercises organized into basic and advanced levels.

This repository is ideal for:

  • Self-learners who want a step-by-step guide
  • Students in classrooms or coding bootcamps
  • Instructors who want ready-to-use lessons and exercises

Each topic is self-contained with example code, so you can run, modify, and experiment without worrying about dependencies.
Exercises come with solutions, allowing you to check your understanding after trying them yourself.


Learning Tips

  1. Start Small – Focus on one lesson at a time.
  2. Run & Modify Code – Change values, loops, and functions to see what happens.
  3. Attempt Exercises First – Try solving problems before checking solutions.
  4. Take Notes – Writing down explanations helps reinforce concepts.
  5. Revisit Topics – Periodically go back to previous lessons; repetition strengthens understanding.
  6. Experiment Beyond the Examples – Try small variations, mini-projects, or integrate multiple lessons.
  7. Use the Exercises Strategically – Stretch challenges are meant to push your problem-solving skills.

Remember: Mastery comes from active practice, not just reading.


Requirements

  • Python 3.8+
  • Install packages (if needed) with:
pip install -r requirements.txt

Basic - Overview

File Description
01_printing_and_comments.py Printing text, numbers, multiple items, escape characters, print() options, comments, and docstrings.
02_variables_and_types.py Variable naming, dynamic typing, common data types, type checking, and type casting.
03_operators.py Arithmetic, comparison, logical, assignment, membership, and identity operators.
04_input_output.py Taking input, type conversion, f-strings, .format(), and % formatting.
05_conditionals.py if/elif/else statements, nested ifs, shorthand if, truthy/falsy values.
06_loops.py for and while loops, break/continue/pass, nested loops.
07_functions.py Defining functions, arguments, return values, scope, and lambda functions.
08_collections.py Lists, tuples, sets, dictionaries, and common operations.
09_strings_in_depth.py Indexing, slicing, string methods, escape sequences, and f-string formatting.
10_file_handling.py Reading/writing files, file modes, and context managers.
11_exceptions.py Try/except blocks, catching specific exceptions, raising exceptions, and finally/else usage.
12_classes_objects.py Classes, attributes, methods, constructors, self, and simple inheritance.
solutions_basic.py Consolidated solutions and examples from all basic topics.

Advanced - Overview

File Description
01_comprehensions.py List, dict, set comprehensions and generator expressions.
02_modules_packages.py Importing built-in modules and creating custom modules/packages.
03_standard_libraries.py Introduction to math, random, datetime, os, and sys.
04_oop_advanced.py Advanced OOP: encapsulation, polymorphism, overriding, class vs instance variables.
05_custom_exceptions.py Raising and handling custom exception classes.
06_virtualenv_pip.py Creating virtual environments and installing packages with pip.
solutions_advanced.py Consolidated solutions and examples from all advanced topics.

Exercises

Each exercise has theory questions, coding tasks, and stretch challenges. Solutions are provided in matching _solutions.py files.

Exercises Solutions
01_exercises.md 01_exercises_solutions.py
02_exercises.md 02_exercises_solutions.py
03_exercises.md 03_exercises_solutions.py
04_exercises.md 04_exercises_solutions.py
05_exercises.md 05_exercises_solutions.py
06_exercises.md 06_exercises_solutions.py

How to Contribute

We welcome contributions from learners, instructors, and developers!

  1. Suggest New Lessons or Topics

    • Open an issue describing the topic or concept you think should be added.
    • Include a brief explanation and any relevant resources.
  2. Improve Existing Lessons

    • Fix typos, improve explanations, or add better examples.
    • Make a pull request (PR) with your improvements.
  3. Add Exercises or Projects

    • Create practical exercises related to any lesson.
    • Include a solution file and make sure it runs correctly.
    • Follow the existing naming conventions: NN_exercises.md and NN_exercises_solutions.py.
  4. Report Bugs or Errors

    • If a code snippet doesn’t run or behaves unexpectedly, open an issue.
    • Provide the error message and the Python version you used.
  5. Code Style and Standards

    • Use clear, readable code with proper comments.
    • Follow PEP 8 where applicable.
  6. Fork & Pull Request Workflow

    • Fork the repository
    • Make your changes in a new branch
    • Submit a PR with a descriptive title and summary
    • For more details: Check first-contributions

Your contributions help make this repo better for everyone learning Python!

If you like this repository, motivate us by starring this repo.

About

Python Notes

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%