[問題] 巴斯卡三角形

看板Python作者 (無)時間15年前 (2010/01/30 00:14), 編輯推噓0(004)
留言4則, 2人參與, 最新討論串1/1
我想請教巴斯卡三角形如何寫! 我在網路上搜尋到 http://caterpillar.onlyfun.net/Gossip/AlgorithmGossip/PascalTriangle.htm 但是裡面的程式碼我輸入後有錯誤 我用的版本是2.54 懇請高手解惑!!!謝謝~~ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.113.178.133

01/30 01:23, , 1F
from __future__ import print_function
01/30 01:23, 1F

01/30 01:24, , 2F
print在3.x版已經是function而不是statement了
01/30 01:24, 2F

01/30 17:56, , 3F
謝謝樓上大大 但我還是不懂><
01/30 17:56, 3F

01/30 18:10, , 4F
把from __future__ .... 放進.py應該就行了
01/30 18:10, 4F
文章代碼(AID): #1BOmc3Ql (Python)
文章代碼(AID): #1BOmc3Ql (Python)