class bldy():
def one (self):
a = 5
return a # return 返回到selfclass
def two(self):
b = 10
return b 變量
def sum(self, a, b): # 你給我兩個參數,我就執行下面的方法
c = a + b
return c方法
if __name__ == '__main__':
dy = bldy() # 實例化
a = dy.one() # 調用方法
b = dy.two()
c = dy.sum(a, b) # 傳入兩個參數
print('c = %d'%c) # 輸出 c=15 格式化輸出(變量輸出用這種方法,爽的不要不要的^-^)return