課程
/后端開發
/Python
/Python3 入門教程(新版)
相關截圖:
相
2021-09-12
源自:Python3 入門教程(新版) 4-4
正在回答
L?=?[75,?92,?59,?68,?99] sum?=?0 counter?=?0 for?x?in?L: ????counter?+=?1 ????sum?+=?x avg?=?sum/counter print(avg)
toment
L = [75,92,59,68,99]
he =0
for ch in L:
? ? he=ch+he
? ? print(he)
print(he/5)
愛吃青李
for外面定義個sum,for里面,item加到sum里,for后面sum除以數組長度
qq_慕虎6311376 提問者
qq_慕虎6311376 提問者 回復 qq_慕虎6311376 提問者
舉報
python3入門教程,讓你快速入門并能編寫簡單的Python程序
3 回答用for循環實現
1 回答For循環
1 回答for 循環報錯
3 回答請問for循環和while循環有什么區別呢
3 回答請問average()按照答案寫的,但是最后算的平均值不對,這是怎么回事呢
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2021-10-26
2021-09-17
L = [75,92,59,68,99]
he =0
for ch in L:
? ? he=ch+he
? ? print(he)
print(he/5)
2021-09-13
for外面定義個sum,for里面,item加到sum里,for后面sum除以數組長度