Answers for "definition of class in python"

3

class python

class Person:
  def __init__(self, name, age):
    self.name = name
    self.age = age

p1 = Person("John", 36)

p1.age = 40

print(p1.age)
---------------------------------------------------------------
40
Posted by: Guest on October-29-2020

Code answers related to "definition of class in python"

Python Answers by Framework

Browse Popular Code Answers by Language