How can I select a variable by (string) name?
How can I select a variable by (string) name? Question: I want to return a pre-determined list from my function, based on the string input. def get_ext(file_type): text = [‘txt’, ‘doc’] audio = [‘mp3’, ‘wav’] video = [‘mp4’, ‘mkv’] return # what do I return here? get_ext(‘audio’) #should return the list [‘mp3’, ‘wav’] What is …