Ive search the internet for my question sadly, i couldn't find any answer. here is the code.
print('a. sugar b. tomato c. honey d. all')
def a_func():
print("sugar")
def b_func():
print("tomato")
def c_func():
print("honey")
func_map = {'a': a_func, 'b':b_func, 'c':c_func 'd':???? }
while True:
func_input = input("Enter a letter 'a' through 'd'!\n")
if func_input.strip() == 'exit':
print('goodbye! ')
exit()
if func_input.strip() in func_map.keys():
func_map[func_input]()
else:
print("Sorry no function for that!")
Now, I want to call all of the functions
If i enter d
The output will be like this.
sugar
tomato
honey
Thank you in advance!