Generate a correct python program to fetch the price of a given stock ticker symbol.
Apple Inc. (AAPL)
import requests

def get_stock_price(symbol):
 url = "https://finance.yahoo.com/quote/" + symbol
 req = requests.get(url)
 data = req.json()
 return data['regularMarketPrice']