Skip to content

Conversation

ianand
Copy link

@ianand ianand commented Sep 3, 2024

Replaced "haved" with "have" for grammatical correctness to improve readability of the comment.

Replaced "haved" with "have" for grammatical correctness to improve readability of the comment.
Copy link

@RahulVadisetty91 RahulVadisetty91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

It should only catch specific exceptions e.g. ValueError, not all exceptions, this can hide bugs or unexpected errors.

Correction:
try:
j = word.index(first, i)
new_word.extend(word[i:j])
i = j
except ValueError:
new_word.extend(word[i:])
break

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants