0
Bug in Sololearn app??
So I’m trying to get past a python level, and I’m solving it but it says indentation error no matter what I do.. even did the stuck -> see solution and did exactly what it has for the solution. Here is the code def convert(num): if num ==0: return 0 return (num % 2 + 10 * convert(num // 2)) a=int(input()) print(convert(a)) It might have screwed up the indentation on this post but I’ve been stuck on it for about a month now. Can anyone help?
3 ответов
+ 3
The problem you are facing this indentation because you are using unequal spaces between each indentation. All indentation should have equal number of spaces.
I hope this helps. Happy coding !!
+ 2
If you're unsure about indentation in python, then read this.......
https://peps.python.org/pep-0008/
+ 1
are you mixing tabs and spaces? or maybe typing the solution in some other ide and copy-pasting it here?
What I usually do is to delete the indentations and re-indent them manually using the spacebar.