python 100题24 题目:有一分数序列:2/1,3/2,5/3,8/5,13/8,21/13…求出这个数列的前20项之和。 a = 1 i = 1 k = 0 #i + a count = 0 #统计分数序列之和 f = 0 # i / a count_times = 1 #执行次数 while count_times <= 20: k = i + a a = i i = k f = i / a count += f count_times += 1 print("前20项和:",count)