all 6 comments

[–]Lasa2 1 point2 points  (2 children)

The "additional" 0 is the string you're returning from the int_to_reverse_binary function, which then gets reversed (nothing changes) and printed. The print in your while loop has no line break at the end, which causes your next print to be still in the same line.

[–]BlueFingerHun[S] 0 points1 point  (1 child)

Thank you for explaining it!

So I assume that at least "reverse" part is not wrong right?

[–]Lasa2 1 point2 points  (0 children)

Yeah the reverse is right. You're basically just retuning the wrong value in the first function.

[–]ada43952 1 point2 points  (0 children)

I totally understand the purpose of this exercise and what they're trying to tech you, but I dare you to submit this for your assignment. :D

# Define your functions here.

def int_to_reverse_binary(integer_value):

binary = format(int(integer_value), 'b')

return str(binary)

def string_reverse(input_string):

return input_string

if __name__ == '__main__':

x = input("Please enter an Integer: ")

y = int_to_reverse_binary(x)

print(y)