Untitled
unknown
python
2 years ago
695 B
2
Indexable
def int_to_reverse_binary(integer_value): x = integer_value binary = '' while x > 0: binary += str(x % 2) x //= 2 return binary def string_reverse(input_string): normal = "" for i in range(len(input_string)): normal = input_string[i] + normal return normal if __name__ == '__main__': # Type your code here. # Your code must call int_to_reverse_binary() to get # the binary string of an integer in a reverse order. # Then call string_reverse() to reverse the string # returned from int_to_reverse_binary(). number = int(input()) print(string_reverse(int_to_reverse_binary(number)))
Editor is loading...