Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[All Your Base] Two tests may be expecting wrong values #3855

Closed
jmodjeska opened this issue Feb 1, 2025 · 2 comments
Closed

[All Your Base] Two tests may be expecting wrong values #3855

jmodjeska opened this issue Feb 1, 2025 · 2 comments

Comments

@jmodjeska
Copy link

jmodjeska commented Feb 1, 2025

I have some feedback on the tests for this exercise: https://exercism.org/tracks/python/exercises/all-your-base.

I believe the intent of the exercise is to treat the input list digits as a single number in the original input_base and to convert that number to a number in output_base expressed as a list of digits. For example, rebase(7, [0, 6, 0], 10) means, "convert 60 from base-7 to base-10."

If that is a correct understanding, then I believe that two of the tests are expecting incorrect results:

First Issue

https://github.com/exercism/python/blob/main/exercises/practice/all-your-base/all_your_base_test.py#L35

    def test_15_bit_integer(self):
        self.assertEqual(rebase(97, [3, 46, 60], 73), [6, 10, 45])
  • 34660 in base-97 is 269295571 in base-10
  • 269295571 in base-10 is 935177131 in base-73

The correct answer should be [9, 35, 17, 71, 31]

Second Issue

https://github.com/exercism/python/blob/main/exercises/practice/all-your-base/all_your_base_test.py#L32

    def test_hexadecimal_to_trinary(self):
        self.assertEqual(rebase(16, [2, 10], 3), [1, 1, 2, 0])
  • 210 in base-16 is 528 in base-10
  • 520 in base-10 is 201120 in base-3

The correct answer should be [2, 0, 1, 1, 2, 0]

Thanks for your time and my apologies if I'm missing something about the exercise or the math involved here.

My code for this challenge, which you're under no obligation to look at unless it's diagnostically useful for you, is here.

Copy link
Contributor

github-actions bot commented Feb 1, 2025

Hello. Thanks for opening an issue on Exercism 🙂

At Exercism we use our Community Forum, not GitHub issues, as the primary place for discussion. That allows maintainers and contributors from across Exercism's ecosystem to discuss your problems/ideas/suggestions without them having to subscribe to hundreds of repositories.

This issue will be automatically closed. Please use this link to copy your GitHub Issue into a new topic on the forum, where we look forward to chatting with you!

If you're interested in learning more about this auto-responder, please read this blog post.

@github-actions github-actions bot closed this as completed Feb 1, 2025
@BethanyG
Copy link
Member

BethanyG commented Feb 1, 2025

Answered in forum post 15390.

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

No branches or pull requests

2 participants