Python 小練習 剔除奇數
這題還比較簡單,函式變數型別是list,要求剔除list內的奇數,保留偶數,但是不修改原來的list,程式碼如下
def purify(old):
new=[]
for n in old:
if n%2==0:
new.append(n)
return new
相關文章
- Python 小練習 剔除列表內重複資料Python
- Python 小練習 求list內中間數Python
- python練習小結Python
- 【python小練習】簡單的猜數字遊戲Python遊戲
- python基礎語句小練習Python
- Python 小甲魚教程 課後練習42Python
- python實現資料分頁小練習Python
- 新手練習:Python練習題目Python
- python練習Python
- 【Python】python練習Python
- 【數字晶片前端】STA時序分析的小練習1晶片前端
- python 練習0000Python
- Python 練習題Python
- Vue+Koa+Mongodb 小練習VueMongoDB
- Python 作業練習Python
- python練習題解析Python
- Python之列表&元組小練Python
- 排序——選擇排序小練習(二)排序
- 排序——選擇排序小練習(一)排序
- Python學習-while迴圈練習PythonWhile
- Python基礎練習題Python
- 五、python的練習題Python
- Python指令碼練習一Python指令碼
- Python 程式設計練習Python程式設計
- Python之檔案讀寫小練Python
- unity 的視錐剔除和遮擋剔除Unity
- java基礎小練習(31-35)Java
- 20160328 javaweb Cookie 小練習JavaWebCookie
- 轉置原理小練習:Do Use FFTFFT
- python練習冊-第0000題Python
- python指令碼練習筆記Python指令碼筆記
- python 檔案讀寫練習Python
- Python之物件導向基礎小練Python物件
- 【演算法練習】(8)眾數演算法
- 【小練習04】HTML+CSS--醫藥健康小頁面HTMLCSS
- 基礎練習——python特殊的數字——2020.11.17Python
- 零基礎學習Python__小甲魚第一課筆記與課後練習Python筆記
- Flutter 1.12 個人練手學習小案例Flutter