Add a one-line docstring to any Python solution (5 min)

Open Beginner friendly
#267 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
92/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
documentation

Research direction

Run grep -rL '"""' solutions/python/ to list candidate files, then open any solutions/python/practiceN.py and find the first def line. Add a single """Short description.""" line directly under it and leave the rest of the file untouched. Done means one file has a docstring, the diff shows only that line, and a pull request is open.

Written by the indexing model from the issue text.

Description

5-minutes beginner-friendly documentation good first issue hacktoberfest help wanted no-code-needed python

Add a one-line docstring to any Python solution (5 min)

Most solution files have a function but no docstring. That makes it hard to understand what the function does at a glance. This issue is about adding exactly one line.

Time: ~5 minutes | Level: Complete beginner

What to do

Pick any file in solutions/python/ where the first function has no docstring. Add one line immediately after the def line:

def two_sum(nums, target):
    """Return indices of two numbers in nums that add up to target."""
    ...

That is the whole change. One line. You are done.

Rules
  • Pick any solutions/python/practiceN.py file where the main function has no docstring
  • Add a single """Short description.""" line as the first line inside the function
  • Do not change anything else in the file
  • Open a Pull Request

You can claim as many files as you want, one PR per file or batch them together.

How to find files that need a docstring:

grep -rL '"""' solutions/python/

That lists every Python file with no triple-quote string at all.


Open for everyone

This issue is open for everyone: beginners, experienced developers, students, and people who don't code at all. Any language, any level, no experience required. If you want to help, you are welcome here.

How to contribute

  1. Fork this repo
  2. Clone your fork and create a new branch
  3. Make your change
  4. Commit, push, and open a Pull Request

New to open source? Start here before anything else:

First Contributions - github.com/firstcontributions/first-contributions

Prefer video? Watch this: How to contribute on GitHub (YouTube)

If this repo helps you or you like where it is going, a star is a nice way to say thanks and helps other people find it. Entirely optional, and you do not need it to contribute.

Dominant language
Python
Stars
3
Forks
2
Avg merge
3h
Merged PRs (30d)
44

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Huerte/algo-solutions-python

All issues in Huerte/algo-solutions-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.