yingweixu 发表于 2013-05-15 11:03 ![]()
回复 3# hellioncu
你的答案和我的答案不一样~ 你的结果是 63, 我的是 73. - #!/usr/bin/python
- people_list = range(100)
- while len(people_list) > 1:
- for i in range(100):
- if i >= len(people_list):
- break
- people_list.pop(i)
- print people_list
- print people_list
复制代码 [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99]
[3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63, 67, 71, 75, 79, 83, 87, 91, 95, 99]
[7, 15, 23, 31, 39, 47, 55, 63, 71, 79, 87, 95]
[15, 31, 47, 63, 79, 95]
[31, 63, 95]
[63]
[63]
貌似没错吧,是从0开始的63个 |