Advertisement
ifran_Uddin

If I give wrong email & password then why it show profile ??

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