Prakash nidhi Verma 04-Jul-2018 The __init__() Function: classes and objects in their simplest form are not really useful in real life applications. It's a built-in __init__() function. Example : Use the __init__() function to assign values for name and age: class Person: def __init__(self, name, age): self.name = name self.age = age p1 = Person('Prakash', 19) print(p1.name) print(p1.age)
Prakash nidhi Verma
The __init__() Function:
classes and objects in their simplest form are not really useful in real life applications. It's a built-in __init__() function.
Example :
Use the __init__() function to assign values for name and age: