对于这个函数,我应该接受两个都是字符串的参数。第一个参数是任何正数,第二个是应该将另一个数字分成组的数字。这是代码示例:
def split_tester(N, d):
# Your code should include dosctrings and the body of the function
if N.isdigit() and d.isdigit():
N1 = int(N)
d1 = int(d)
substring = ""
new_sub = ""
retsub = ""
for i in N:
substring = substring + i
if len(substring) == d1:
new_sub = new_sub +substring+ " "
substring = ""
print(new_sub)
所以在 shell 中它会打印12 34when split_tester("1234","2"). 我的问题是,当这些被转换为字符串并且在同一个变量中时,如何证明 34 大于 12?
慕妹3146593
相关分类