Consider a list I want to parse using a for
:
friends = [\"Joe\", \"Zoe\", \"Brad\", \"Angelina\", \"Zuki\", \"Thandi\", \"Paris\"]
for i in fri
I would use a dictionary instead, as I too spent a while looking into this, and determined that a dictionary would be easy enough.
friends = ["Joe", "Zoe", "Brad", "Angelina", "Zuki", "Thandi", "Paris"]
dict= {}
for i in friends:
dict[i] = i
print(dict)
print(dict['Zuki'])
dict['Zuki'] = "Tim Smith"
print(dict['Zuki'])
The Other option would be to just call the number:
print(friends[0])
As for automatic assignment I haven't found a way to do it.