Recursion Python Challenge, please help
Hello guys, following: The given code defines a recursive function convert(), which needs to convert its argument from decimal to binary. However, the code has an error. Fix the code by adding the base case for the recursion, then take a number from user input and call the convert() function, to output the result. Sample Input: 8 Sample Output: 1000 This is my code so far: def convert(num): if num<=1: return 0 else: return (num % 2 + 10 * convert(num // 2)) bin=int(input()) convert(bin) iÂŽve got a few questions, maybe you can help me solve them: -Is my Base case correct? I thought of choosing it <1 because otherwise it would keep up the division nearly infinite. But i didnt know what to return after it reaches <1 so i thought about zero what obviously isnt correct. -Do i have an input problem? i neither get any output. -Or did i do something wrong with the function. Would be cool if someone could help me out, really struggling with this one and couldnt find any help in the web. Thanks and have a good start in the week!