python如何用集合来定义自然数系统
求解!!! 我是个笨比,求解!!!sets = ('{}', )
def get_set(x):
the_set = '{'
for i in range(0, x): the_set += (sets + ',')
the_set = the_set[:len(the_set)-1] + '}'
return the_set
x = int(input())
for i in range(1, x+1): sets += (get_set(i), )
print(sets)
tommyyu 发表于 2022-11-28 15:33
太感谢了!!!
页:
[1]