0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Dividend Yield Formula - Python Code

Posted at

Dividend Yield Formula

\text{Dividend Yield} = \frac{\text{Annual Dividend Payment}}{\text{Stock Price}} \times 100%

where:
Annual Dividend Payment is the total amount of dividends paid out over the course of a year
Stock Price is the current market price of the stock

Python Code

dividend_yield.py
def dividend_yield(annual_dividend, stock_price):
    yield_pct = (annual_dividend / stock_price) * 100
    return yield_pct


annual_dividend = 4.00
stock_price = 110.00

yield_pct = dividend_yield(annual_dividend, stock_price)

print("Dividend yield: {:.2f}%".format(yield_pct))

# Output: Dividend yield: 3.64%
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?