Fix Incorrect Comment in String Indexing Example
Personne n'a encore pris cette issue.
- #87 par @rajnee28 — fermée sans fusion
Évaluation
- Difficulté
- 1/5
- Temps estimé
- Moins d'une heure
- Accessibilité débutants
- 58/100
- Type d'issue
- Documentation
- Clarté
- Clairement spécifiée
- Activité
- À l'abandon
- Stack technique
- python
- Domaine
- documentation
Piste de recherche
Open src/data_types/test_strings.py and inspect the string indexing example around the two assertions. Update the inaccurate position comment so it matches the zero-based index, then verify that the example remains valid and the comment identifies the character correctly.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Hello,
I've noticed a small error in the comments of the string indexing example provided in the [src/data_types/test_strings.py]. The comment incorrectly refers to the sixth character of the string as the "Fifth character".
Current Code:
word = 'Python'
assert word[0] == 'P' # First character.
assert word[5] == 'n' # Fifth character.
Issue:
The comment for assert word[5] == 'n' incorrectly states "Fifth character" while it actually checks the sixth character of the string word.
Suggested Correction:
word = 'Python'
assert word[0] == 'P' # First character.
assert word[5] == 'n' # Sixth character.
Correction Explanation:
Python strings are zero-indexed, so the first character is at index 0, and the sixth character is at index 5. The proposed change corrects the comment to accurately reflect the character's position in the string.
I hope this helps improve the documentation/code for future readers. If it's okay, I can submit a pull request #83 with this minor fix.
Thank you for your attention to this matter.
Best regards,
fancling
- Langage dominant
- Python
- Étoiles
- 18.4k
- Forks
- 3k
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de trekhleb/learn-python
-
Typo in Variable Name: "weapon.strip()" Should Be "fruit.strip()" in List Comprehensions ExamplePeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 82/100
trekhleb/learn-python#105 · 1 commentaire ·
-
Incorrect Comment About Accessing Dictionary ElementsPeut-être à nouveau libre @udumulamythiliram l’a pris il y a 113 jours, et aucune pull request n’est ouverte. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 72/100
trekhleb/learn-python#104 · 1 commentaire ·
-
Learning PythonOuverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 10/100
trekhleb/learn-python#108 ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 30/100
trekhleb/learn-python#107 · 1 commentaire ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
trekhleb/learn-python#106 ·
Toutes les issues de trekhleb/learn-python
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
TomerAberbach/profiler-md#733 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
its-me-prash/vwgroup-connect-ha#1858 ·
Les mainteneurs répondent en général sous 1 jour
-
area: client bug
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Les mainteneurs répondent en général sous 1 jour
-
Deleting all alarms or timers shows deleted ones until the next update when there are none leftOuvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
leikoilja/ha-google-home#1107 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Graphify-Labs/graphify#4524 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour