Answers for "create a class with 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
1

class methods in python

@classmethod
def func(cls, args...)
Posted by: Guest on November-14-2020

Code answers related to "create a class with python"

Python Answers by Framework

Browse Popular Code Answers by Language