Answer to Question #208583 in Python for Andu

Question #208583

How to explain this code???


if(choice=="1"):#Sign up: register to the system

      newAccount=Account()

      newAccount.signUp()

      accounts.append(newAccount)

      saveAccounts(accounts,FILE_NAME)

    elif(choice=="2"):#Sign in

      username =input("Enter the username of the account: ")

      password =input("Enter the password of account: ")

       

      accountExist=False

      for acc in accounts:


1
Expert's answer
2021-06-19T07:00:26-0400
if(choice=="1"):#Sign up: register to the system


    #instatiate new class object called newAccount
    newAccount=Account()
     
    # newAccount allows for sign up by calling function namely SignUp
    newAccount.signUp()


    #append the signup values to accounts db
    accounts.append(newAccount)


    #saves the account values in the file by calling function namely saveAccounts()
    saveAccounts(accounts,FILE_NAME)


elif(choice=="2"):#Sign in


    #ask users to input username
    username =input("Enter the username of the account: ")


    #ask users to input usernam
    password =input("Enter the password of account: ")


       
    #deactivate accountExit to execute loop
    accountExist=False


    #check every value in accounts
    for acc in accounts:

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS