首页 > 解决方案 > 创建一个新帐户并登录到一个帐户

问题描述

如果他或她是第一次用户,我可以问如何要求用户创建一个新帐户,如果他或她不是第一次用户,请要求用户登录?

#Register Swinburne Sarawak Account
print("Please register for a login account with Swinburne Sarawak.")
def RegisterAccount():
    while True:
        RegisterAccount = ""
        RegisterAccount = input("Are you a first time user of our online portal? ([Y]Yes/[N]No)")
        FirstTimeUser = RegisterAccount.upper()
        if FirstTimeUser == "Y":
            print("You will need to create your account as a new student.")
        elif FirstTimeUser == "N":
            print("User Already Exist. Please login as a returning user.")
        else:
             continue
        break

RegisterAccount()

标签: pythonfunction

解决方案


推荐阅读