How to make an input create a variable
I want to be able to create new variables without having to go into the code is there any way to do this
Giothecoder
Show us an example, please. I don’t think it is but, just try and show us an example first.
Giothecoder
Hey guys, isn’t there some weird scoping with var in js that would allow something like this?
AlexanderBirabe
Considering your profile says you code in python, I think you're looking for:
variableName = input("prompt")
The variable 'variableName' gets set to a string of what the user types in (they have to hit enter to submit). You can replace 'prompt' with whatever you want the input prompt to be.
theangryepicbanana
What language are you using?
If you are using Python like mentioned in the comments, you can use a dictionary to do this. To create the variables, you can use a function like:
You can then access your variables from the dictionary, like so:
Hope this is what you were looking for.