问题解决了,想再问问mylist=list(mylist)转化成[[1,1,1,1],[2,2,2,2],[3,3,3,3]],和[1,1,1,1],[2,2,2,2],[3,3,3,3]有什么区别?,谢谢~
回答于 2021-09-23 23:05
判断求余数等于0的跳出就可以了。for x in range(2,100): for factor in range(2,x): if x % factor ==0: break else: print(x)复制代码
回答于 2021-09-23 23:04
谢谢!我用了个笨办法,改成这样算是勉强通过了,但是感觉很啰嗦,请问我怎么改那一部分比较好呢? def is_legitmate_code(code): code_letters = ["A", "B", "Z", "T", "X"] min_for_each_letter = [2, 2, 1, 0, 4] max_for_each_letter = [8, 9, 6, 7, 5] code_list = code.split() code2 = "" ...
回答于 2021-09-23 22:23