Agathe1489 commited on
Commit
87f4c38
·
verified ·
1 Parent(s): 891bd21

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -16,11 +16,9 @@ def get_stock_price(ticker: str) -> str:
16
  Fetches the latest stock price for a given ticker symbol from Yahoo Finance.
17
 
18
  Args:
19
- ticker (str): The stock ticker symbol (e.g., "AAPL" for Apple).
20
 
21
- Returns:
22
- str: The current stock price or an error message if the price cannot be retrieved.
23
- """
24
  url = f"https://finance.yahoo.com/quote/{ticker}"
25
  headers = {"User-Agent": "Mozilla/5.0"} # Avoid bot detection
26
  response = requests.get(url, headers=headers)
 
16
  Fetches the latest stock price for a given ticker symbol from Yahoo Finance.
17
 
18
  Args:
19
+ ticker: A string representing the stock ticker symbol (e.g., "AAPL" for Apple).
20
 
21
+
 
 
22
  url = f"https://finance.yahoo.com/quote/{ticker}"
23
  headers = {"User-Agent": "Mozilla/5.0"} # Avoid bot detection
24
  response = requests.get(url, headers=headers)