You are viewing a single comment's thread. Return to all comments →
This code gives an error, "TypeError: unsupported operand type(s) for -: 'str' and 'int'"
Someone please tell me what it is and how to fix it.
number = int(input()) for i in range(1, number+1): print(str(i).rjust(len(bin(i) - 2))) print(oct(i)[2:].rjust(len(bin(i) - 2))) print(oct(i)[2:].rjust(len(bin(i) - 2))) print(oct(i)[2:].rjust(len(bin(i) - 2)))
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 →
This code gives an error, "TypeError: unsupported operand type(s) for -: 'str' and 'int'"
Someone please tell me what it is and how to fix it.