Closed Kessi69 closed 1 month ago
Hey
I suggest giving it another try. I ran your code, and it is working perfectly fine. This happens sometimes when there is a problem with Yahoo Finance. I would suggest making your code robust by handling conditions when it gives a KeyError.
Describe bug
C:\Users\basse>python nvidia_stock_tool.py Current Stock Information for NVDA: Company Name: NVIDIA Corporation Traceback (most recent call last): File "C:\Users\basse\nvidia_stock_tool.py", line 34, in
display_stock_data(hist, info)
File "C:\Users\basse\nvidia_stock_tool.py", line 20, in display_stock_data
print(f"Current Price: ${info['regularMarketPrice']:.2f}")