python语言程序设计第五章二的3解析

def foo(num,base):
if (num>=base):
foo(num//base,base)
print(num%base,end=' ')

foo(25,2)

求解析,谢谢🙏

就是十进制转二进制的实现
25是十进制,2是进制位数