How can i shorten this condition pattern;
if xconditon == "a text":
Avariable = Yvariable
elif xcondition == "b text":
Bvariable = Yvariable
elif xcondition == "c text":
Cvariable = Yvariable
condition goes on like this, there is a pattern so I am searhing for ways to shorten this code.
>Solution :
Don’t use different variables, use a dictionary.
mydict[xcondition] = Yvariable