Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
15 lines (12 loc) · 332 Bytes

File metadata and controls

15 lines (12 loc) · 332 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# -*- coding:utf-8 -*-
__author__ = 'gjw'
__time__ = '2018/1/8 0008 下午 1:46'
# 题目:有一分数序列:2/1,3/2,5/3,8/5,13/8,21/13...求出这个数列的前20项之和。
# 程序分析:请抓住分子与分母的变化规律。
a = 2
b = 1
s = 0
for i in range(20):
s += a/b
a, b = a+b, a
print(s)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.