def menuProductNumbers(lst):
    '''
        Calculate the product of numbers from a start position to an end position
        input data:
        lst - the list of all complex numbers
        
        output data:
        lst' - the new list of complex numbers
    '''
    start_position = readParameter("Input <start position>: ")
    end_position = readParameter("Input <end position>: ")
    args = []
    addElementToList(args, start_position)
    addElementToList(args, "to")
    addElementToList(args, end_position)
    uiProductNumbers(lst, args)
def menuReplaceNumber(lst):
    '''
        Receive an old number and a new number and try to replace the old with the new one
        
        input data:
        lst - the list of all complex numbers
        
        output data:
        lst' - the new list of complex numbers 
    '''
    old_number = readParameter("Input <old number>: ")
    new_number = readParameter("Input <new number>: ")
    args = []
    addElementToList(args, old_number)
    addElementToList(args, "with")
    addElementToList(args, new_number)
    uiReplaceNumber(lst, args)
def menuInsertNumber(lst):
    '''
        Receive a complex number and a certain position from the list and try to insert in list
        
        input data:
        lst - the list of all complex numbers
        
        output data:
        lst' - the new list of complex numbers 
    '''
    complex_number = readParameter("Input <number>: ")
    index = readParameter("Input <position>: ")
    args = []
    addElementToList(args, complex_number)
    addElementToList(args, "at")
    addElementToList(args, index)
    uiInsertNumber(lst, args)
def menuListNumbers(lst):
    '''
        Receive a list operation:
        1 - list all numbers from the list
        2 - list all real numbers from a start position to an end position
        3 - list all numbers having modulo <, >, =, <= or >= than a given number
        
        input data:
        lst - the list of all complex numbers
        
        output data:
        lst' - the new list of complex numbers
    '''
    menu_type = 0
    while menu_type != 1 and menu_type != 2 and menu_type != 3:
        menu_type = input(
            "1: list all numbers, 2: list real numbers: , 3: list all numbers having modulo <, >, =, <= or >= than a given number: "
        )
        if checkIntegerNumber(menu_type) == True:
            if menu_type == 1:
                args = []
                uiListNumbers(lst, args)
            else:
                if menu_type == 2:
                    start_position = readParameter("Input <start position>: ")
                    end_position = readParameter("Input <end position>: ")
                    args = []
                    addElementToList(args, start_position)
                    addElementToList(args, "to")
                    addElementToList(args, end_position)
                    uiListNumbers(lst, args)
                else:
                    if menu_type == 3:
                        sign = readParameter(
                            "Chose a sign (>, <, =, <=, >=): ")
                        number = readParameter("Input <number>: ")
                        args = []
                        addElementToList(args, "modulo")
                        addElementToList(args, sign)
                        addElementToList(args, number)
                        uiListNumbers(lst, args)
                    else:
                        print("Invalid input, try again!")
def menuAddNumber(lst):
    '''
        Receive a complex number and try to add in list
        
        input data:
        lst - the list of all complex numbers
        
        output data:
        lst' - the new list of complex numbers 
    '''
    complex_number = readParameter("Input <number>: ")
    args = []
    addElementToList(args, complex_number)
    uiAddNumber(lst, args)
def menuRemoveNumber(lst):
    '''
        Receive a remove operation:
        1 - remove a certain position
        2 - remove from a start position to an end position
        
        input data:
        lst - the list of all complex numbers
        
        output data:
        lst' - the new list of complex numbers 
    '''
    menu_type = 0
    while menu_type != 1 and menu_type != 2:
        try:
            menu_type = int(
                input(
                    "1: remove position, 2: remove start position to end position: "
                ))
            if menu_type == 1:
                index = readParameter("Input <position>: ")
                args = []
                addElementToList(args, index)
                uiRemoveNumber(lst, args)
            else:
                if menu_type == 2:
                    start_position = readParameter("Input <start position>: ")
                    end_position = readParameter("Input <end position>: ")
                    args = []
                    addElementToList(args, start_position)
                    addElementToList(args, "to")
                    addElementToList(args, end_position)
                    uiRemoveNumber(lst, args)
                else:
                    print("Invalid input, try again!")
        except ValueError:
            print("Invalid input, try again!")