Ad Block 1
avatar
Functions.py

Guest 109 15th May, 2019

                                           
                         def main():
    letters = input("enter four letter type code: ")
    letters = letters.lower() #input is case insensitive

    #convert the four letter to boolean for readability
    isE = (letters[0] == 'e')
    isN = (letters[1] == 'n')
    isF = (letters[2] == 'f')
    isP = (letters[3] == 'p')
    if (isE == isP): #EPs and IJs
        firstFunction = getPFunction(isN,isE)
        secondFunction = getJFunciton(isF,not isE)
        thirdFunction = getJFunciton(not isF, isE)
        forthFunciton = getPFunction(not isN, not isE)
    else: #EJs and IPs
        firstFunction = getJFunciton(isF,isE)
        secondFunction = getPFunction(isN,not isE)
        thirdFunction = getPFunction(not isN, isE)
        forthFunciton = getJFunciton(not isF, not isE)
    print("function stack is " + firstFunction + secondFunction + thirdFunction + forthFunciton)

def getPFunction(isN,isE):
    if isN:
        if isE:
            return "Ne"
        else:
            return "Ni"
    else:
        if isE:
            return "Se"
        else:
            return "Si"

def getJFunciton(isF,isE):
    if isF:
        if isE:
            return "Fe"
        else:
            return "Fi"
    else:
        if isE:
            return "Te"
        else:
            return "Ti"

while True:
    main()
                      
                                       
To share this paste please copy this url and send to your friends
RAW Paste Data
Ad Block 2

Comments

Authentication required

You must log in to post a comment.

Log in
    There are no comments yet.