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

Aperta Adatta ai principianti
#364 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
65/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
documentation

Direzione di ricerca

Inizia con grep -rL '"""' solutions/python/ per elencare i file Python che non contengono alcuna stringa tra triple virgolette. Apri un solutions/python/practiceN.py e individua la sua funzione main. Aggiungi un unico docstring su una riga come prima riga all'interno di quella funzione e non modificare nient'altro nel file. È fatto quando quel file contiene il docstring e il diff tocca solo quella riga.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
3
Fork
2
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Huerte/algo-solutions-python

Tutte le issue di Huerte/algo-solutions-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.