Welcome to the Hacktoberfest 2025 Python Code Contribution Repository! This is a beginner-friendly project designed to help developers make their first open-source contributions during Hacktoberfest, focusing specifically on Python programming.
- Provide a welcoming space for first-time Python contributors
- Collect diverse Python code samples, algorithms, and utilities
- Help participants learn Git and GitHub workflows
- Foster a supportive open-source community
- Promote Python best practices and clean code
Hacktoberfest-2025/
βββ README.md # You are here!
βββ CODE_OF_CONDUCT.md # Community guidelines
βββ CONTRIBUTING.md # Detailed contribution guide
βββ LICENSE # MIT License
βββ .github/ # GitHub templates
β βββ PULL_REQUEST_TEMPLATE.md
β βββ ISSUE_TEMPLATE/
βββ python/ # Python code samples
βββ README.md # Python-specific guidelines
βββ hello_world.py # Example contribution
We welcome the following types of Python contributions:
- β Algorithms (sorting, searching, graph algorithms, etc.)
- β Data structures implementations
- β Utility functions and helper scripts
- β Bug fixes and improvements
- β Documentation enhancements
- β Code optimizations and refactoring
Click the "Fork" button at the top right of this page.
git clone https://github.com/YOUR-USERNAME/Hacktoberfest-2025.git
cd Hacktoberfest-2025git checkout -b feature/your-contribution-name- Add your Python code in the
python/folder - Follow PEP 8 style guidelines
- Include type hints and docstrings
- Add comments for complex logic
- Test your code before committing
git add .
git commit -m "Add: Brief description of your contribution"Commit Message Format:
Add: [description]- for new featuresFix: [description]- for bug fixesUpdate: [description]- for updates to existing codeDocs: [description]- for documentation changes
git push origin feature/your-contribution-name- Go to your fork on GitHub
- Click "New Pull Request"
- Fill in the PR template with details about your contribution
- Wait for review!
- Well-documented code with comments
- Unique algorithms or utilities
- Code that follows language best practices
- Meaningful variable and function names
- Includes examples of usage
- Has proper error handling
- Duplicate code
- Spam or meaningless changes
- Plagiarized code
- Code without documentation
- Breaking existing functionality
- Incomplete implementations
- Follow PEP 8 Python style guide
- Add comprehensive docstrings explaining your code
- Include type hints for function parameters and return values
- Use meaningful variable and function names
- Use meaningful commit messages
- One feature per pull request
- Include example usage in your code
def fibonacci(n: int) -> list[int]:
"""
Generate Fibonacci sequence up to n terms.
Args:
n (int): Number of terms to generate
Returns:
list[int]: Fibonacci sequence
Raises:
ValueError: If n is negative
Example:
>>> fibonacci(5)
[0, 1, 1, 2, 3]
"""
if n < 0:
raise ValueError("n must be non-negative")
if n == 0:
return []
elif n == 1:
return [0]
sequence = [0, 1]
for i in range(2, n):
sequence.append(sequence[i-1] + sequence[i-2])
return sequence
if __name__ == "__main__":
print(fibonacci(10))class Stack:
"""
A simple stack implementation using a list.
Supports push, pop, peek, and is_empty operations.
"""
def __init__(self):
"""Initialize an empty stack."""
self._items: list = []
def push(self, item) -> None:
"""Add an item to the top of the stack."""
self._items.append(item)
def pop(self):
"""Remove and return the top item from the stack."""
if self.is_empty():
raise IndexError("Pop from empty stack")
return self._items.pop()
def peek(self):
"""Return the top item without removing it."""
if self.is_empty():
raise IndexError("Peek from empty stack")
return self._items[-1]
def is_empty(self) -> bool:
"""Check if the stack is empty."""
return len(self._items) == 0def is_palindrome(text: str) -> bool:
"""
Check if a string is a palindrome (ignoring case and non-alphanumeric characters).
Args:
text (str): The string to check
Returns:
bool: True if palindrome, False otherwise
Example:
>>> is_palindrome("A man a plan a canal Panama")
True
>>> is_palindrome("hello")
False
"""
cleaned = ''.join(char.lower() for char in text if char.isalnum())
return cleaned == cleaned[::-1]We are committed to providing a welcoming and inclusive environment for all contributors. Please:
- β¨ Be respectful and considerate
- π€ Accept constructive criticism gracefully
- π― Focus on what's best for the community
- β€οΈ Show empathy towards other contributors
- π« No harassment, discrimination, or inappropriate behavior
See our full Code of Conduct for details.
This project is licensed under the MIT License - see the LICENSE file for details.
Thanks to all our amazing contributors! π
- π Create an Issue for bug reports or feature requests
- π¬ Join our discussions in the Discussions tab
- β Star this repository if you find it helpful!
Give a βοΈ if this project helped you contribute to Hacktoberfest!
Happy Hacking! π
Made with β€οΈ for Hacktoberfest 2025