Introducción a Python para finanzas
Adina Howe
Professor
Guarda información para usarla en el código
msft_stock, interest_rate, bondsinterest_rate = 0.05
Nombres de variables
class o type) y hay que evitarlos# Correcto
day_2 = 5
# Incorrecto: el nombre empieza por un dígito
2_day = 5
$$ \text{Price to earning ratio} = \frac{\text{Market price}}{\text{Earnings per share}} $$
price = 200 earnings = 5pe_ratio = price / earningsprint(pe_ratio)
40
Introducción a Python para finanzas