- 博客(5)
- 收藏
- 关注
原创 Python 流程控制
補充額外流程控制語法 range 函數 class range( stop ) class range( start , stop [ , step ] ) >>> list(range(10)) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> list(range(1, 11)) [1, 2, 3, 4, 5, 6, 7, 8, 9,...
2019-07-13 22:57:15 146
原创 Calculate GPA using Python
import pandas as pd excel_path = 'GPA.xlsx' d = pd.read_excel(excel_path, sheetname=None) D:\anacorda\lib\site-packages\pandas\io\excel.py:329: FutureWarning: The `sheetname` keyword is deprecated, u...
2019-07-13 22:55:32 592
原创 Python Class & Inheritance
class class myclass: i = 12345 def f(self): return 'willy is handsome' #將 myclass 實例化 x = myclass() #訪問 class 裡的屬性 & 方法 print(x.i) print(x.f()) >>> 12345 >>> w...
2019-07-13 22:53:03 237
原创 Python 3.7 常用內建函數
abs(x) 返回數字的絕對值。參數可以是整數或浮點數。如果參數是一個複數,則返回其大小。如果x定義_abs_(),則 abs(x)返回x._abs_()。 int x = -5 abs.(x) #5 x._abs_() #5 all(可迭代的) 如果 iterable 的所有元素為真(或迭代器為空),返回True。等價於: def all(iterable): for ele...
2019-07-13 22:50:37 194
原创 Python list
list.append( x ) list = ['willy','chang','FJU','Handsome','code','PC','iphone'] list.append('genius') list # ['willy', 'chang', 'FJU', 'Handsome', 'code', 'PC', 'iphone', 'genius'] del list[] del lis...
2019-07-13 22:49:23 80
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人