I just pulled out some old code but I'm curious to know how to jump back to a specific line of code. What I mean by this is that if there is an if statement, it will do something unless told otherwise, anyways, what I want to do is when the if statement ends, or when I get to the else bit, I want the code to not start all over again but start at a certain line in the code. I will explain more below:
CODE:
def main():
    abc = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz'
    message = input("What's the message to encrypt/decrypt? ")
    def keyRead():
        try:
            return int(input("What number would you like for your key value? "))
        except ValueError:
            print("You must enter a number!")
            main()
    key = keyRead()
    choice = input("Choose: encrypt or decrypt. ")
    if choice == "encrypt":
        encrypt(abc, message, key)
    elif choice == "decrypt":
        encrypt(abc, message, key * (-1))
    else:
        print("You must chose either 'encrypt' or 'decrypt!'")
        main()
def encrypt(abc, message, key):
    cipherText = ""
    for letter in message:
        if letter in abc:
            newPosition = (abc.find(letter) + key * 2) % 52
            cipherText += abc[newPosition]
        else:
            cipherText += letter
    print(cipherText)
    return cipherText
main()
So what I want really is that if the user doesn't input encrypt or decrypt it will show them the message: You must enter either 'encrypt' or 'decrypt'! but under this line I want it to go back to the choice part and not all the way back to the message part. If there is a way to do this I would really appreciate you helping me out!!
 
     
    