Python noob here so forgive me if I have an easy question. I want to set the variable name to whatever value I am passing using my for loop.
roles = ["A" , "B" , "C"]
for role in roles:
print (role)
"outPutFor"+role = function_that_gives_outputforRole(role)
So I want my variables to read outPutForA
, outPutForB
and outPutForC
.
but I am getting the below ERROR
"outPutFor"+role = function_that_gives_outputforRole(role)
^
SyntaxError: can't assign to operator
What am I missing here ?