Answers for "how to call the class in python"

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
-1

how to create class in python

x.counter = 1
while x.counter < 10:
    x.counter = x.counter * 2
print(x.counter)
del x.counter
Posted by: Guest on June-18-2021

Code answers related to "how to call the class in python"

Python Answers by Framework

Browse Popular Code Answers by Language