Thank you for considering contributing to Mastering Python – 200 Exercises! This project exists to help learners practice Python effectively. Your ideas, exercises, and fixes are welcome.
- Add Exercises → New problems for Learners
- Improve Solutions → Alternate or optimized approaches with explanations.
- Fix Issues → Typos, bugs, unclear instructions — anything that improves learning.
- Enhance Docs → Better explanations, tips, or clarifications for beginners.
-
Placement: Create a New Branch and Add PROBLEMS in a FOLDER
-
Naming: Use a clear, incremental pattern:
01_hello_world.py102_functions.py181_decorators.py
-
Self-Contained: No external libraries unless absolutely necessary.
-
I/O Style: Keep input/output minimal. Prefer function-based solutions.
-
Clarity: Include a brief docstring at the top with task, examples, constraints.
"""
Title: Reverse a String
Level: Beginner
Task: Write a function reverse_string(s) that returns the reverse of s.
Examples:
reverse_string("abc") -> "cba"
reverse_string("") -> ""
"""
def reverse_string(s: str) -> str:
return s[::-1]
if __name__ == "__main__":
print(reverse_string("hello"))- Follow PEP 8.
- Use type hints where helpful.
- Prefer pure functions; avoid global state.
- Add inline comments for tricky logic.
- Use
if __name__ == "__main__":guard for demos/tests.
-
Fork the repository.
-
Create a branch
git checkout -b feat/add-palindrome-exercise
-
Commit changes with clear messages
git commit -m "feat: add palindrome checker exercise (intermediate)" -
Push your branch
git push origin feat/add-palindrome-exercise
-
Open a Pull Request explaining:
- What you changed and why
- Where it fits (basics / intermediate / advanced)
- Any references or notes
- Files in the correct folder
- Clear, incremental file name
- Docstring with task + examples
- Code is readable and self-contained
- Tested locally
Be respectful, helpful, and constructive. The goal is to make learning Python enjoyable and accessible.
All valid contributors will appear in GitHub’s Contributors section. Thank you for helping learners grow 🚀🐍