Sharpaxis commited on
Commit
8e7fc56
·
verified ·
1 Parent(s): 84aff53

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -21,7 +21,9 @@ def daily_stock_data(symbol: str)-> str: #it's import to specify the return type
21
  end_date = datetime.now().strftime("%Y-%m-%d")
22
  ticker = yf.Ticker(symbol)
23
  df = ticker.history(start=start_date, end=end_date, auto_adjust=True)
24
- return f"Today's Stock data for {symbol}:Open : {df['Open'].iloc[0]} High : {df['High'].iloc[0]} Low : {df['Low'].iloc[0]} Close : {df['Open'].iloc[0] Volume : {df['Volume'].iloc[0]}"
 
 
25
  except Exception as e:
26
  return f"Error fetching stock data for {symbol}: {str(e)}"
27
 
 
21
  end_date = datetime.now().strftime("%Y-%m-%d")
22
  ticker = yf.Ticker(symbol)
23
  df = ticker.history(start=start_date, end=end_date, auto_adjust=True)
24
+ return f"""
25
+ Today's Stock data for {symbol}:Open : {df['Open'].iloc[0]} High : {df['High'].iloc[0]} Low : {df['Low'].iloc[0]} Close : {df['Open'].iloc[0] Volume : {df['Volume'].iloc[0]}
26
+ """
27
  except Exception as e:
28
  return f"Error fetching stock data for {symbol}: {str(e)}"
29