I just started coding recently and did all my coding exercises within one file, so I want to organize it by making a code that tells me what function do I want to run. Here's the code:
print('''choices:
dict
emojis
''')
run = input('What do you want to run? ')
funct = {
'dict': 'dict()',
'emojis': 'emojis_prog()'
}
output = ""
for prog in run:
output = funct.get(prog, "That program does not exist!")
print(output)
edit: Ok so I have a python file that contains my short programming exercises and it's organized through def dict(): def emojis_prog(): def greet_user(name):
. So I want to run these programs by making a code (within the same python file), where you specifically tell it what to run. So if I want to run the dict program, I would simply input here run = input('What do you want to run? ')
dict
and it would run that only