Back to questions

Base 13 Conversion Capital One Python Interview Question

Base 13 Conversion

Capital One Python Interview Question

Given an integer , return its string representation in base 13.

In case you don’t use base 13 that much (who does, right?), here’s a quick rundown: just like base 10 uses digits from 0 to 9. But also for 10, 11 and 12, we use the letters A, B, and C.

For example:

  • 9 in base 13 is still
  • 10 in base 13 is
  • 11 in base 13 is
  • 12 in base 13 is
  • 13 in base 13 is
  • 14 in base 13 is
  • 49 in base 13 is (since 313+10=493*13 + 10 = 49)
  • 69 in base 13 is (since 513+4=695*13 + 4 = 69)

Input

(Python)

Output