Python 金融入門
Adina Howe
Professor
在程式中儲存可引用的資訊
msft_stock、interest_rate、bondsinterest_rate = 0.05
變數命名
class、type),請避免使用# 正確
day_2 = 5
# 錯誤,變數名稱以數字開頭
2_day = 5
$$ \text{本益比} = \frac{\text{市價}}{\text{每股盈餘}} $$
price = 200 earnings = 5pe_ratio = price / earningsprint(pe_ratio)
40
Python 金融入門