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: ")
# 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
Comments
Leave a comment