Advertisement
niamulhasan

Untitled

Jan 11th, 2019
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. class User:
  2. name = ''
  3. email = ''
  4. password = ''
  5. login = False
  6.  
  7. def __init__(self, name, email, password):
  8. self.name = name
  9. self.email = email
  10. self.password = password
  11.  
  12. def login(self):
  13. email = input("Enter email: ")
  14. password = input("Enter password: ")
  15.  
  16. if email == self.email and password == self.password:
  17. login = True
  18. print("Login Successful!")
  19. else:
  20. print("Login Faild!")
  21.  
  22. def logout(self):
  23. login = False
  24. print("Logged Out!")
  25.  
  26. def isLoggedIn(self):
  27. if self.login:
  28. return True
  29. else:
  30. return False
  31.  
  32. def profle(self):
  33. if self.isLoggedIn():
  34. print(self.name,"-",self.email)
  35. else:
  36. print("User is not Logged in!")
  37.  
  38.  
  39. user1 = User("Adam", "adam@testmail.com","12345")
  40.  
  41. user1.login()
  42. user1.profle()
  43.  
  44.  
  45. hello = input()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement