導航:首頁 > 編程語言 > python大型作業程序設計

python大型作業程序設計

發布時間:2022-05-08 03:25:36

python編程大作業,求教大神,非常急!!!!

信息錄入與查找系統有償,指點。

❷ Python程序設計

import os
f=open("D:\speech.txt")
all = f.readlines() # 讀取文本中所有內容,並保存在一個列表中,列表中每一個元素對應一行數據
s=[]
print(all)
for i in all:
k=i.split(' ')
for j in k:
s.append(j)
print(s)
print("文件大小(bite)是:"+str(os.path.getsize("D:\speech.txt")))
print("單詞個數是:"+str(len(s)))
顯示:
E:\Django_lianxi\venv\Scripts\python.exe D:/Test_work/test.py
['I have an apple,you have a dog,\n', 'your dog eat my apple.\n', "what't a fuck."]
['I', 'have', 'an', 'apple,you', 'have', 'a', 'dog,\n']
['I', 'have', 'an', 'apple,you', 'have', 'a', 'dog,\n', 'your', 'dog', 'eat', 'my', 'apple.\n']
['I', 'have', 'an', 'apple,you', 'have', 'a', 'dog,\n', 'your', 'dog', 'eat', 'my', 'apple.\n', "what't", 'a', 'fuck.']
文件大小(bite)是:71
單詞個數是:15

閱讀全文

與python大型作業程序設計相關的資料

熱點內容
keil5編程32單片機 瀏覽:635
pdf文件截取 瀏覽:159
伺服器放到雲上和雲下有啥區別 瀏覽:672
單片機玻璃管加熱研究成果 瀏覽:762
財產pdf 瀏覽:797
java添加圖標 瀏覽:892
命令與征服4任務攻略 瀏覽:97
演算法和邏輯程序驗證 瀏覽:773
用戶管理系統php模板 瀏覽:425
中國銀行app賬號怎麼登錄 瀏覽:873
安卓手機icloud雲伺服器地址 瀏覽:808
加密門禁如何寫到小米手機 瀏覽:177
java靜態方法的多線程 瀏覽:273
CAXAXp下載打不開要加密 瀏覽:252
開鎖pdf 瀏覽:96
python可視化奶茶 瀏覽:232
命令方字幕 瀏覽:594
蘋果手機如何連接ipad伺服器 瀏覽:988
列印矩陣java 瀏覽:407
如何雙開一個不能雙開的app 瀏覽:542