I was just wondering if there was a way I could create variables from string like in the code below, I can create a file which includes the variable subject in the filename.
filehandle = open('data_' + Subject + '.py', 'w')
And here I can create a new variable with the string name in the name when the file is imported.
filehandle.write('High' + Game + 'Score = 0')
Which when I import it as a module, the variable name would be like HighMinecraftScore if Game = "Minecraft", HighMarioScore if Game = "Mario" etc.
I was just wondering if anyone knew how I accomplish the same results, as I'd hope to use it in a way in which I can create new variables with matching names autonomously.
Is there any way I can accomplish this without having to write or import modules?
Thank You