Skip to content

Commit

Permalink
Step 2: User model
Browse files Browse the repository at this point in the history
  • Loading branch information
99omniaashraf committed Mar 15, 2024
1 parent 8682850 commit 834dfbc
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions 0x01-challenge/user.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/python3
"""
User class
"""

class User():
""" Documentation """

def __init__(self):
""" Documentation """
self.__email = None

@property
def email(self):
""" Documentation """
return self.__email

@email.setter
def email(self, value):
""" Documentation """
if type(value) is not str:
raise TypeError("email must be a string")
self.__email = value



if __name__ == "__main__":

u = User()
u.email = "[email protected]"
print(u.email)

0 comments on commit 834dfbc

Please sign in to comment.