from: https://www.finrafoundation.org/sites/finrafoundation/files/dividend-paying-stocks.pdf - Money math for teens - Dividend paying stocks

To compute yield, use

round((dividend / stock_price) * 100, 1)

For example

In [6]:
def yield_pct(dividend, stock_price):
    res = round((dividend / stock_price) * 100, 1)
    return res


In [7]:
dividend = 1.55; stock_price = 82.00

In [8]:
yield_pct(1.55, 82.00)
Out[8]:
1.9

So, if a company pays \$1.55 dividend and its stock price is \$82.00, then the yield is 1.9%

pg-5

pg-10