Class in Python
- what is class in python?
- properties and methods in class?
- how to create an object from class?
- how to reasign the property value?
- how to delete asiged value of property and method?
class MyClass:
prop1 = 5
object1 = MyClass()
print(object1.property)
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
def myMethod(self):
print("Hello"+self.name+" have a good day")
p1 = Person("Ilai",25)
print(p1.name)
print(p1.age)
p1.myMethod()
p1.age = 26
del p1.age
del p1
class Student(Person):