def get_search_type(find2remove = False):
    """Helper that lets the user decide with search_type to use

    The flag find2remove is used to show if the funciton is called from the remove-function.
    This affect which message that appears in the prompt.
    """
    search_type = ""
    while True:
        try:
            if find2remove:
                msg = "How do you want to find the contact to remove?\n'1': By name\n'2': By phone\n~ "
            else:
                msg = "How do you want to find the contact?\n'1': By name\n'2': By phone\n~ "
            search_type = int(input(msg))

            if search_type == 1 or search_type == 2:
                return search_type
            else:
                print("\nPlease enter a number in range 1-2\n")
        except ValueError:
            print("\nPlease enter a number in range 1-2\n")