<reponame>angelopassaro/Hacktoberfest-1<gh_stars>1-10
class User:
	# username
	# password
	# email
	# name

	# getdetails
	# change name
	# change mail
	# every time use try to creat a new object it calls inti
	count = 0 #Class Variable , User1 check and user2 checks the same value will come
	def __init__(self,username,password,email,name):
		self.user_name=username
		self.password=password
		self.email=email
		self.name=name
		# instance variables
		# all these variables will be available with any function in the class

	def login(self,username,password):
		if ((self.user_name==username) and (self.password==password)):
			print("Login Succesful")
		else:
			print("Invalid Creditianles")
	def get_details(self):
		return self.user_name 


user1=User("abc","abc@123","abc@xyz","abc")
# User(user1,"abc","abc@123","abc@xyz","abc")
user2=User("pqr","pqr@<PASSWORD>","pqr@xyz","pqr")
# python always passes the object as the frist argument
# print(user1.user_name)
# print(user2.user_name)
# one of the advantage is same functions is used by different objects . Code reuseablity
# user1.login("abc","abc@<PASSWORD>")


# two types of variables:
# 1.instance variable :
	# if every object has its own set of variable
# 2.Class variable entirely class will have same value
# Example:- We need to count total no of users present 

# print(user1.count)
# Changing a class variable
# User.count=100
# print(user1.count)

# user1.count= 500
# print(User.count)#100
# print(user1.count)#500
# print(user2.count)#100

# We are trying to change a class variable using object.
# in that case python will create a local variable for user1

# print(user1.__dict__)
# print(user2.__dict__)
# print(User.__dict__)

# User.count=82
# print(user1.count)
# It will change the user1.count also



# Inheritance
# class Profile(User):
# 	pass

# user3=Profile("uday123","password","<EMAIL>","uday")
# print(user3.user_name)

# in Inheritance all the variables and functions will be available to the inherited class
# + he can create his own functions and variables

# class Profile(User):
# 	def __init__(self,user_name,password,email,name,contact,fb):
# 		super().__init__(user_name,password,email,name)
# 		self.contact_no=contact
# 		self.facebook=fb

# user4=Profile("uday123","password","<EMAIL>","uday","7123456789","www.fb/dog.com/sfsf/fsgerg")
# print(user4.__dict__)


class Demo:
	def get_details():
		return "Hi from Demo"


# Now we inherit from both the class 

class Profile(User,Demo):
	def __init__(self,user_name,password,email,name,contact,fb):
		super().__init__(user_name,password,email,name)
		self.contact_no=contact
		self.facebook=fb
	def get_details(self):
		return super().get_details(),self.contact_no

user5=Profile("qwe123","qwer","<EMAIL>","qwe",789123456,"www.fb.com/sdsdf/sdrgtg")
# print(user5.get_details()) #('qwe123',789123456)


#if we use Demo,User it will return ('Hi from demo',789123456)

# help(Profile)
# It is calculated by Depth frist left to Right
# See the Method Resolution Order


