摘要:
#a 与 b必须是两个相同类型的可迭代对象 a = "1" b = "2" print(set(a + b)) # {'1', '2'} a = "123" b = "2" print(set(a + b)) # {'1', '2', '3'} a = ['1', '3', 2] b = ['2'] 阅读全文
摘要:
输出由1,2,3,4组成的互不相同且无重复的三位数! #方式一 lst = ['1', '2', '3', '4'] res = [] for i in lst: for j in lst: for k in lst: # print(set(i + j + k)) if len(set(i + j 阅读全文