<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_action(args):
 """Return a function to launch the web browser or print a result"""

    redirect_mode = args.bang or args.search or args.lucky
    if redirect_mode and not args.url:
        return webbrowser.open_new_tab
    else:
        return print_result