Introduction à Python pour la finance
Adina Howe
Professor
Stockez des informations réutilisables dans le code
msft_stock, interest_rate, bondsinterest_rate = 0.05
Noms de variables
class ou type) ; à éviter# Correct
day_2 = 5
# Incorrect, variable name starts with a digit
2_day = 5
$$ \text{Ratio cours/bénéfice} = \frac{\text{Cours}}{\text{Bénéfice par action}} $$
price = 200 earnings = 5pe_ratio = price / earningsprint(pe_ratio)
40
Introduction à Python pour la finance