
Python 入門指南 5.0
exercise0710.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # 設定儲存結果的變數 result = 0 # 計算第 20 個費式數列數字 F0 = 0 F1 = 1 result = F0 + F1 for i in range(2, 10): F0 = F1 F1 = result result = result = F0 + F1 # 印出結果 print(result) # 檔名: exercise0710.py # 說明:《Python入門指南》的練習 # 網站: http://kaiching.org # 作者: 張凱慶 # 時間: 2023 年 8 月 |
