So if I assigned a to a string with the character b in it, how do I get the character from the a string and use it to assign it to another value?
I tried:
a = "b"
a.strip("") = 2
# so that b = 2
print(b)
>> 2
I need it because I have a list with stock ticker symbols and want to access it when I iterate through the ticker symbol list. eg.
tickers = ["TSLA", "SPCE"]
for i in range(len(tickers)):
print(tickers[i]["Adj Close"])
This however throws out an error.
Thank you in advance