Skip to content

Commit

Permalink
fix: python sample bug (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwmkerr authored Jan 31, 2025
1 parent 167a6d3 commit 6937497
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions samples/programs/lookup/lookup-v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

# Add the word to our list of lookups, and strip any whitespace from the
# beginning and end of it. For now, we don't have a definition.
word = word.strip()
stripped_word = word.strip()
definition = ""

# Write the result.
print(word, " - ", definition)
print(stripped_word, " - ", definition)
3 changes: 1 addition & 2 deletions samples/programs/lookup/lookup-v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ def search_for_word(word):
continue

# Strip whitespace from the word and find the definition.
word = word.strip()
stripped_word = word.strip()
definition = search_for_word(stripped_word)

# Write the result.
print(word, "-", definition)
print(stripped_word, "-", definition)
3 changes: 1 addition & 2 deletions samples/programs/lookup/lookup-v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,8 @@ def write_definition(word, definition):
continue

# Strip whitespace from the word and find the definition.
word = word.strip()
stripped_word = word.strip()
definition = search_for_word(stripped_word)

# Write the result.
write_definition(word, definition)
write_definition(stripped_word, definition)
3 changes: 1 addition & 2 deletions samples/programs/lookup/lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,8 @@ def read_words():
continue

# Strip whitespace from the word and find the definition.
word = word.strip()
stripped_word = word.strip()
definition = search_for_word(stripped_word)

# Write the result.
write_definition(word, definition)
write_definition(stripped_word, definition)

0 comments on commit 6937497

Please sign in to comment.