How do you convert base 12 to base 10 in Python 3 and the other way around too? (from 10 to 12)
I wrote this code to make a list of numbers in base 4, but the code never executes and eventually has a timeout error. Any ideas on how to fix it? It also identifies the mode and counts the frequency of the mode. The program should start at 1 and print the next 21 numbers in base 4 and then do the mode stuff.
while num > 0:
if start in yes:
list4.append(start)
start += 1
num -= 1
if start not in yes:
num += 1
new_4 = ''.join([str(n) for n in list4])
print(statistics.mode(new_4))
count_m = new_4.count(statistics.mode(new_4))
print(count_m)
Comment any other questions you may have!