I am trying to return a function but as list NAME, in another function should accept a list but it seems it return string into the second function
choices = ['a', 'b','c']
a = ['1','2','3']
b = ['4','5','6']
c = ['7','8','9']
choices = tuple(choices)
def let_user_pick(choices):
print("Please choose:")
for idx, element in enumerate(choices):
print("{}) {}".format(idx+1,element))
i = int(input("Enter number: "))
if 0 < int(i) <= len(choices):
return choices[i-1]
def a2_only(data):
print(data)
a2_only(let_user_pick(choices))
so I need to run the second function as below (logically calling a list not string)
a2_only(c) NOT a2_only('c')
Current ouput:
Please choose:
1) a
2) b
3) c
Enter number: 3
c
expected ouput:
['7','8','9']