You are viewing a single comment's thread. Return to all comments →
padLen = len(bin(number)[2:]) for i in range(number): print(str(i+1).rjust(padLen) + ' ' + str(oct(i+1)[2:].rjust(padLen)) + ' ' + str(hex(i+1).upper()[2:].rjust(padLen)) + ' ' + str(bin(i+1)[2:]).rjust(padLen))
OR
print(f'{str(i + 1).rjust(padLen)}{str(oct(i + 1)[2:].rjust(padLen))}{str(hex(i + 1).upper()[2:].rjust(padLen))}{str(bin(i + 1)[2:]).rjust(padLen)}')
Seems like cookies are disabled on this browser, please enable them to open this website
String Formatting
You are viewing a single comment's thread. Return to all comments →
OR