Answer to Question #208525 in Python for Andu

Question #208525

How to explain this code?



import pathlib 

import json



class Account:

  #Constructor

  def __init__(self):

    self.username =""

    self.password =""

    self.name =""

    self.suname =""

    self.birthDate =""

    self.listFriends = [] #(characterised by the account username)

       

  #This function allows to create a new Account

  def signUp(self):

    self.username =input("Enter the username: ")

    self.password =input("Enter the password: ")

    


1
Expert's answer
2021-06-18T12:33:38-0400
# import the pathlib module
import pathlib 
#import the json module
import json

# define a class Account
class Account:


  #Constructor


  def __init__(self):


    self.username ="" #define a variable username and initialize it to empty string


    self.password ="" #define a variable password and initialize it to empty string


    self.name ="" #define a variable name and initialize it to empty string


    self.suname ="" #define a variable suname and initialize it to empty string


    self.birthDate ="" #define a variable birthDate and initialize it to empty string


    self.listFriends = [] #(characterised by the account username)

  #This function allows to create a new Account


  def signUp(self):


    self.username =input("Enter the username: ") #get the value of username from the user


    self.password =input("Enter the password: ") #get the value of password from the user

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