Answers for "python create class method"

4

python class

class Person:
  def __init__(self, name, age):
    self.name = name
    self.age = age
  def myfunc(self):
    print("Hello my name is " + self.name +".")

p1 = Person("Victor", 24)
p1.myfunc()
Posted by: Guest on April-30-2021

Code answers related to "python create class method"

Python Answers by Framework

Browse Popular Code Answers by Language