本文目錄一覽:
python入門教程
《【3】學習視頻》百度網盤資源免費下載
鏈接:
提取碼:m6tm
【3】學習視頻|python視頻教程|Python入門基礎視頻教程|lets python 視頻教程|Lets-python-017-文件和輸入輸出01.avi|Lets-python-016-條件和循環02-練習題和生成器.avi|Lets-python-015-條件和循環01.avi|Lets-python-014-映射和集合02.avi|Lets-python-013-映射和集合01.avi|Lets-python-012-序列04-02.avi|Lets-python-012-序列04-01.avi|Lets-python-011-del和getattr.avi|Lets-python-010-序列03.avi|lets-python-009-序列02.avi|Lets-python-008-序列01.avi
求python入門視頻教程,雲盤分享謝謝
《視頻-python從0開始學編程》百度網盤資源免費下載
鏈接:
提取碼:bwqf
視頻-python從0開始學編程|day9視頻.rar|day8視頻.rar|day7視頻.rar|day6視頻.rar|day5視頻.rar|day4視頻.rar|day3視頻.rar|day2視頻.rar|day1視頻.rar|day19視頻.rar|day18視頻.rar|day17視頻.rar|day16視頻.rar|day15視頻.rar
Python視頻教程,百度雲
[python視頻教程] lets python視頻教程免費下載
鏈接:
提取碼:dxpn
[python視頻教程] lets python 視頻教程|Lets-python-017-文件和輸入輸出01.avi|Lets-python-016-條件和循環02-練習題和生成器.avi|Lets-python-015-條件和循環01.avi|Lets-python-014-映射和集合02.avi|Lets-python-013-映射和集合01.avi|Lets-python-012-序列04-02.
python 編程
代碼使用python3.x版本,依賴第三方庫openpyxl
安裝openpyxl命令如下:
pip install openpyxl
python代碼如下:
import openpyxl
import re
INPUT_FILE = ‘input.txt’
OUTPUT_FILE = ‘result.xlsx’
with open(INPUT_FILE, ‘r’, encoding=’utf-8′) as f:
wb = openpyxl.Workbook()
ws = wb.active
for line in f:
words = re.split(‘[,,\n]’, line)
vals = words[2:]
for w in vals:
try:
float(w)
except ValueError as e:
words.remove(w)
else:
if words.count(w) 1:
for i in range(words.count(w)-1):
words.remove(w)
vals = words[2:]
vals.sort(reverse=True)
if len(vals) 4:
vals = vals[:3] + vals[-1:]
words = words[:2] + vals
ws.append(words)
wb.save(OUTPUT_FILE)
若代碼格式有亂,請參照下圖:
測試結果:
原創文章,作者:UTAJ9,如若轉載,請註明出處:https://www.506064.com/zh-hk/n/128510.html