Converting a number to base 64
问题 So I am trying to program (in Python 3 without strings) this cool project that I found. Return the 6-character string representation of the 36-bit number n as a base-64 number in reverse order where the order of the 64 numerals is: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-+ For example, encode(0) → '000000' encode(9876543210) → 'gR1iC9' encode(68719476735) → '++++++' What I have so far is: def encode(n): SYM = {'0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7':