Answers for "python create object from class name"

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 "python create object from class name"

Python Answers by Framework

Browse Popular Code Answers by Language