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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -8
app.py CHANGED
@@ -21,14 +21,7 @@ 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"""
25
- Today's Stock data for {symbol}:
26
- Open : {df['Open'].iloc[0]}
27
- High : {df['High'].iloc[0]}
28
- Low : {df['Low'].iloc[0]}
29
- Close : {df['Open'].iloc[0]}
30
- Volume : {df['Volume'].iloc[0]}
31
- """
32
  except Exception as e:
33
  return f"Error fetching stock data for {symbol}: {str(e)}"
34
 
 
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