當前位置:首頁 » 編程語言 » pythonzen

pythonzen

發布時間: 2025-03-08 13:47:42

㈠ 用python編寫程序5.新建一個文本文件zen.txt, 文件內容為「Python之禪」的部分內容,具體如下

strList=[]

line=0

f=open("zen.txt","r")

forvinf.readlines():

arr=v.split()

strList.extend(arr)

line+=1

f.close()

print('行數:',line)

print('單詞:',len(strList))

#行數:4

#單詞:20

㈡ python 編程之禪 怎麼顯示出來

import this
對是的import this這個類就好了
this這個類的內容是根據一定演算法將一些字元重新排列組合變成the zen of python(python之禪)並且在這個類的__(main)__里把python之禪print出來

熱點內容
安卓應用市場下載的app在哪裡 發布:2025-05-01 18:27:34 瀏覽:924
寶來自舒有哪些配置 發布:2025-05-01 18:05:12 瀏覽:803
sqloracle計算天數 發布:2025-05-01 17:59:23 瀏覽:460
快考題源碼 發布:2025-05-01 17:45:48 瀏覽:367
python生成文檔 發布:2025-05-01 17:32:31 瀏覽:318
上傳文件不存在 發布:2025-05-01 17:30:02 瀏覽:536
android開機 發布:2025-05-01 17:13:29 瀏覽:259
配置文件怎麼下載 發布:2025-05-01 16:50:13 瀏覽:889
c語言買百雞 發布:2025-05-01 16:49:23 瀏覽:18
比色演算法 發布:2025-05-01 16:41:06 瀏覽:288