How to do a function in Python? : im very new at coding and im learning python. im doing an simple program just to test my skills and im having some difficulties with getting a few info and turn it in a function to let the code cleanner. The error that im getting is this one: http://prntscr.com/im5pt7 

Here is what i want to put inside a function:

    name = input(str("\nFull Name: "))       
    position = input(str("Position at the company: "))
    print("\nConfirm Staff Data:\n")
    name_confirm = "Name: %s"%(name)
    position_confirm = "Position: %s"%(position)
    print(name_confirm)
    print(position_confirm)
    confirmAns = input("Is the information right? (Y/N)")
    if confirmAns == "y" or confirmAns == "Y":
        message = "\nSearching for %s"%(name)
        print(message)
        hoursWorked = int(input("Insert hours worked: "))
        if hoursWorked <= 0:
                print("Please insert a valid number")
        elif hoursWorked > 0:
                print("\nCalculete Paycheck")
                hourRate = int(input("Insert the rate of each hour worked: "))
                bonus = input("If a bonus was given insert it here: ")
                fine = input("If a fine was given insert it here: ")
                print('\n')
                payment = hoursWorked*hourRate-int(fine)+int(bonus)
                paymentMsg = "Your Payment is: $%d"%(payment)
                print(paymentMsg)
    elif confirmAns == "n" or confirmAns == "N":
        ctypes.windll.user32.MessageBoxW(0, "The software will close to avoid slowness.", "Warning", 1) 
    else:
        print("Please answer with Y or N")
        
I've tried [**THAT**][1] but it did not worked.
Here is all the code (working but with out the function so i need to copy and paste code): https://pastebin.com/PA9mxMkk


  [1]: https://pastebin.com/i7yxfMtL