0

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
Coder
  • 75
  • 6
  • 2
    Why do you want to do this? This seems like an XY problem – SuperStormer Dec 23 '20 at 22:39
  • So I have a list with stock ticker symbols and want to access it when I iterate through the ticker symbol list. eg. tickers = ["TSLA"] -> print(tickers[0]["Adj Close"]) – Coder Dec 23 '20 at 23:00

0 Answers0