Skip to content

[Wordy] Add tuple-and-index approach#4202

Open
Yrahcaz7 wants to merge 3 commits into
exercism:mainfrom
Yrahcaz7:wordy-new-approach
Open

[Wordy] Add tuple-and-index approach#4202
Yrahcaz7 wants to merge 3 commits into
exercism:mainfrom
Yrahcaz7:wordy-new-approach

Conversation

@Yrahcaz7
Copy link
Copy Markdown
Contributor

Adds another Wordy approach as discussed in this PR.

Also fixes a few errors in the Wordy approach docs that were missed in that PR.

Copy link
Copy Markdown
Member

@BethanyG BethanyG left a comment

Choose a reason for hiding this comment

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

Approving this - good work!!

The three things I found are more suggestion than "OMG change this". So you can decide if you agree or disagree. 😄

LMK if you'd like to let this sit, or have it merged. Thanks for doing this!!

If there *is* an extra operator word, then we need to check if it is present as the next word in `words`.
If it is not present, we raise a `ValueError`, else we increment `operand_index` by `1` to get the correct index.

Here we call the helper function again, setting `operand` to the number at index `operand_index`, and raising a `ValueError` if it is not a number.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You might want to name the helper function since this explanation is long enough to have to scroll back up to see the code.

Comment thread exercises/practice/wordy/.approaches/tuple-and-index/content.md Outdated
Comment thread exercises/practice/wordy/.approaches/tuple-and-index/content.md Outdated
Co-authored-by: BethanyG <BethanyG@users.noreply.github.com>
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