I am tinkering with some code online and stumbled upon this one :
import os
import time
#Must Access this to continue.
def main():
    while True:
        UserName = input ("Enter Username: ")
        PassWord = input ("Enter Password: ")
        if UserName == 'Bob' and PassWord == 'rainbow123':
            time.sleep(1)
            print ("Login successful!")
            logged()
        else:
            print ("Password did not match!")
def logged():
    time.sleep(1)
    print ("Welcome to ----")
main()
I am trying to make it so after the username and password has been implemented, that this sequence happens next:
def mainname():
    while True:
        Firstname = input("Enter First Name:")
        Lastname = input("Enter Last Name:")
        if Firstname == 'Cher, Madonna':
            time.sleep(2)
            print("May I have your autograph, please?")
        else:
            print("that's a nice name")
mainname()
But what happens is, after I put in the username and password it then loops back to inputting the username and password. How do I make it so after the username and password has been implemented, then it goes to the first name and last name sequence? Thank you very much for the help
 
     
     
    