We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Strings
- String Formatting
- Discussions
String Formatting
String Formatting
Sort by
recency
|
1689 Discussions
|
Please Login in order to post a comment
OR
def print_formatted(number): l = len(bin(n)[2:]) f = lambda x: x[2:].rjust(l)
def print_formatted(n): width = len(bin(n)[2:])
if name == 'main': n = int(input()) print_formatted(n)