forked from mblahnik/Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
account.py
37 lines (29 loc) · 904 Bytes
/
account.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
class account():
accountName = ""
def __init__(self, accountName=""):
self.accountName = accountName
self.accountInfo = {
"address": "",
"password": "password",
"Home Phone": "",
"title": 0,
"Email": "",
"Office Phone": "",
"Office hours": ""
}
def getName(self):
return self.accountName
def setName(self,newName):
self.accountName = newName
def setInfo(self, info, newInfo):
if info in self.accountInfo:
self.accountInfo[info] = newInfo
else:
raise(ValueError("Not a valid field"))
def getInfo(self, info):
if info in self.accountInfo:
return self.accountInfo[info]
else:
raise (ValueError("Not a valid field"))
def __str__(self):
return self.accountName