導航:首頁 > 編程語言 > 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大型作業程序設計相關的資料

熱點內容
朗讀者app會員怎麼下載 瀏覽:269
java讀取單詞 瀏覽:547
android查看網關 瀏覽:419
下載的主題在文件夾中找不到 瀏覽:16
在線攻擊伺服器什麼意思 瀏覽:229
ce怎麼改安卓系統 瀏覽:12
php分頁顯示代碼 瀏覽:911
吃甜的東西緩解壓力 瀏覽:171
有什麼手勢舞app 瀏覽:89
固定收益pdf 瀏覽:409
java排序comparator 瀏覽:500
如何只輸入伺服器上的ip 瀏覽:490
單片機稱號 瀏覽:194
phpsocket並發多少 瀏覽:578
tomcat安裝php 瀏覽:78
clay黏土伺服器怎麼加黏土 瀏覽:765
androidsetcolor 瀏覽:174
手機如何登陸主機伺服器 瀏覽:531
雲伺服器被停用怎麼辦 瀏覽:238
轉發app源碼 瀏覽:31