You are viewing a single comment's thread. Return to all comments →
Shorter way to get the binary list:
n = int(input().strip()) binary = [] while n > 0: remainder = n%2 binary.append(remainder) n = n//2 print(binary)
Day 10: Binary Numbers
You are viewing a single comment's thread. Return to all comments →
Shorter way to get the binary list: