Can I format a variable in python? -


Is there a way to create a variable? For example, I create a variable called Auto M_color , where M is a string of value "bingo". The end result will be bingo_color if the value of M changes during execution, then what should I do?

This is the problem of using the best solution dictionaries:

  color_of = {} M = "bingo" color_of [M] = "red" print (color_of [M])  

Comments