I have written code for converting decimal to binary using recursive method and not any built-in function. After executing the code I am getting the output along with 'None'. Here is the code for it.
def binary(n):
if n > 1:
binary(n//2)
print(n % 2, end= '')
print(binary(7))
I am getting the output as 111None.
Why am I getting None in the output ?