-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuser.py
44 lines (35 loc) · 1.36 KB
/
user.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
38
39
40
41
42
43
44
"""Module for class definition of a user"""
class User:
"""Represents a user
Args:
name (string): The name of the user
email (string): The email of the user
job_description (string): The job description of the user
password (string): User's password.. in plaintext 😎
"""
def __init__(self, name, email, job_description, password): # constructor
# attributes/properties
self.name = name
self.email = email
self.job_description = job_description
self.password = password
# methods
def change_password(self, new_pass):
"""Method to change a user's password
Args:
new_pass (string): The new password
"""
self.password = new_pass
print("Password changed\n")
def change_job_description(self, new_description):
"""Method to change a users's job description
Args:
new_description (string): The new, job description
"""
self.job_description = new_description
print(f"-->Job description for user {self.name} has been updated\n")
def get_user_info(self):
"""Method to get user information"""
print("Getting information for user...\n")
print(
f"Username: {self.name} \nEmail: {self.email}\n{self.name} works as {self.job_description}\n") # noqa: E501