Python---金字塔1
>>:金字塔1
代码:
numbers2 = [] for value in range(0,10): number = value+1 numbers2.append(number) print(numbers2) for value2 in numbers2: number2 = value2-1 munbers2 = numbers2.pop(-1) print(numbers2) for value2 in numbers2: number2 = value2-1 munbers2 = numbers2.pop(-1) print(numbers2) for value2 in numbers2: number2 = value2-1 munbers2 = numbers2.pop(-1) print(numbers2) print("\n") print(len(numbers2))
输出结果:
[1] [1, 2] [1, 2, 3] [1, 2, 3, 4] [1, 2, 3, 4, 5] [1, 2, 3, 4, 5, 6] [1, 2, 3, 4, 5, 6, 7] [1, 2, 3, 4, 5, 6, 7, 8] [1, 2, 3, 4, 5, 6, 7, 8, 9] [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] [1, 2, 3, 4, 5, 6, 7, 8, 9] [1, 2, 3, 4, 5, 6, 7, 8] [1, 2, 3, 4, 5, 6, 7] [1, 2, 3, 4, 5, 6] [1, 2, 3, 4, 5] [1, 2, 3, 4] [1, 2, 3] [1, 2] [1] 1
相关推荐
gggwfn 2019-04-22
pritywawa 2019-04-07
sunlinyi 2013-01-15
心理学哲学批判性思维 2018-01-18
心理学哲学批判性思维 2018-01-18
我在国博讲故事 2018-01-12
BitTigerio 2018-01-10
祖先 2018-01-10
中国科普博览 2018-01-09
黑白漫文化 2018-01-08
理科生是设计师 2018-01-06
祖先 2018-01-05
OBAFGKM 2018-01-03
心理学哲学批判性思维 2018-01-03
HeroesinMyHeart 2018-01-02
理科生是设计师 2018-01-02
黑白漫文化 2018-01-01