将十进制正整数转化为二进制数,对应的Python 程序如下:
def toStr(n,base):
s = "01"
if n < base:
return s[n]
else:
return ①
n = int(input('请输入正整数:'))
result = toStr(n,2)
print(result)
则代码中①处的语句可为( )
- A、toStr(n // base, base) + s[n % base]
- B、s[n % base] + toStr(n // base, base)
- C、toStr(n % base, base) + s[n // base]
- D、s[n // base] + toStr(n % base, base)