Python Class Syntax

PHOTO EMBED

Wed May 19 2021 09:35:33 GMT+0000 (UTC)

Saved by @benrobo #php #javasc #html #python

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

p1 = Person("John", 36)

print(p1.name)
print(p1.age)
content_copyCOPY