Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Typo in Variable Name: "weapon.strip()" Should Be "fruit.strip()" in List Comprehensions Example

オープン 初心者向け
#105 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
82/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
python
領域
documentation

調査の方向性

リポジトリで関数 test_list_comprehensions() を検索し、fresh_fruit を使用しているリスト内包表記の例を確認してください。ローカル変数 weapon の名前を fruit に変更し、その後、利用可能であれば該当する Python の例またはテストを実行して、既存のアサーションが引き続きパスすることを確認してください。

索引モデルが issue の本文から書いたものです。

説明

In the function test_list_comprehensions(), under the list comprehension that cleans up whitespace from a list of fruit names, the variable weapon is used instead of a more context-appropriate name such as fruit. This can be confusing for readers and may lead to misunderstandings, as the list is called fresh_fruit and contains fruit names.

Current code:

fresh_fruit = ['  banana', '  loganberry ', 'passion fruit  ']
clean_fresh_fruit = [weapon.strip() for weapon in fresh_fruit]
assert clean_fresh_fruit == ['banana', 'loganberry', 'passion fruit']

Suggested change:
Change weapon to fruit for clarity and consistency:

clean_fresh_fruit = [fruit.strip() for fruit in fresh_fruit]

This will improve code readability and maintain consistency with the context of the example.

主要言語
Python
スター
18.3k
フォーク
3k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

trekhleb/learn-python のほかの issue

trekhleb/learn-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。