예제 #1
0
def product_ui(listOfComplexNb):
    startPosition = ts.checkNbIsNat(
        input("Enter the position from where you want to start deleting: "))
    endPosition = ts.checkNbIsNat(
        input("Enter the position where you want to end deleting: "))
    complexNb = fs.getProduct(startPosition, endPosition, listOfComplexNb)
    print(complexNb)
예제 #2
0
def removeSeq_ui(listOfComplexNb):
    startPosition = ts.checkNbIsNat(
        input("Enter the position from where you want to start deleting: "))
    endPosition = ts.checkNbIsNat(
        input("Enter the position where you want to end deleting: "))
    fs.removeSq(startPosition, endPosition, listOfComplexNb)
    print("The sequence was removed!")
예제 #3
0
def insert_ui(listOfComplexNb):
    complexNbStrg = input("Give me the complex number of form a+bi: ")
    ts.testComplexForm(complexNbStrg)
    complexNb = fs.complexNbFromString(complexNbStrg)
    position = ts.checkNbIsNat(
        input("Enter the position where you want to put the new number: "))
    fs.insert(complexNb, listOfComplexNb, position)
    print(complexNbStrg + " was successfuly inserted!")
예제 #4
0
def filterMod_ui(listOfComplexNb):
    if (len(listOfComplexNb) > 0):
        prop = ts.checkProIsOk(input("Write one of the properties [<|=|>]:"))
        nb = ts.checkNbIsNat(
            input("Write the number you want to comapre with the modulo: "))
        listOfComplexNb = fs.filterModulo(prop, nb, listOfComplexNb)
        print("Modulo filter applied!")
    else:
        print("List is empty, filter can not be applied.")
예제 #5
0
def listModulo_ui(listOfComplexNb):
    prop = ts.checkProIsOk(input("Write one of the properties [<|=|>]:"))
    nb = ts.checkNbIsNat(
        input("Write the number you want to comapre with the modulo: "))
    fs.listModulo(prop, nb, listOfComplexNb)
예제 #6
0
def listReal_ui(listOfComplexNb):
    startPosition = ts.checkNbIsNat(
        input("Enter the position from where you want to start deleting: "))
    endPosition = ts.checkNbIsNat(
        input("Enter the position where you want to end deleting: "))
    uiPrintList(fs.listReal(startPosition, endPosition, listOfComplexNb))
예제 #7
0
def removePos_ui(listOfComplexNb):
    position = ts.checkNbIsNat(
        input("Enter the position where you want to put the new number: "))
    fs.remove(position, listOfComplexNb)
    print("Complex number of position " + str(position) +
          " was successfuly removed!")