Skip to content

Instantly share code, notes, and snippets.

@eguyd
Last active November 12, 2020 02:56
Show Gist options
  • Save eguyd/7ab864ac24dfadb9d0de434f4a76e982 to your computer and use it in GitHub Desktop.
Save eguyd/7ab864ac24dfadb9d0de434f4a76e982 to your computer and use it in GitHub Desktop.
A main function that tests the conversion function with numbers in several bases.
"""
Define a function decimalToRep that returns the representation of an integer in a
given base. The two arguments should be the integer and the base. The function
should return a string. It should use a lookup table that associates integers with
digits. Include a main function that tests the conversion function with numbers
in several bases.
"""
@eguyd
Copy link
Author

eguyd commented Jun 23, 2019

Define a function decimalToRep that returns the representation of an integer in a
given base. The two arguments should be the integer and the base. The function
should return a string. It should use a lookup table that associates integers with
digits. Include a main function that tests the conversion function with numbers
in several bases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment