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

Đang mở Phù hợp với người mới
#252 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
85/100
Loại issue
Tài liệu
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
documentation

Hướng nghiên cứu

Chọn một tệp trong solutions/python/ có hàm chính không có docstring; issue gợi ý dùng grep -rL '"""' solutions/python/ để tìm các ứng viên. Thêm một dòng docstring ngắn ngay sau dòng def của hàm và giữ nguyên phần còn lại của tệp. Công việc hoàn tất khi hàm đã chọn có docstring một dòng rõ ràng và thay đổi được gửi trong một pull request.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
3
Fork
2
Merge trung bình
3 giờ 8 phút
Pull request đã merge (30 ngày)
37

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Huerte/algo-solutions-python

Tất cả issue của Huerte/algo-solutions-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.