<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def select_visualization(n):
 """ get viz choice based on numerical index """

    try:
        n = int(n) - 1
        test = VISUALIZATIONS_LIST[n]  # throw exception if number wrong
        return n
    except:
        printDebug("Invalid viz-type option. Valid options are:", "red")
        show_types()
        raise SystemExit(1)