python classes explained

class uneclasse():
  def __init__(self):
    pass
  def something(self):
    pass
xx = uneclasse()
xx.something()

4
4
Awgiedawgie 440220 points

                                    class Person:
  def __init__(self, _name, _age):
    self.name = _name
    self.age = _age
   
  def sayHi(self):
    print('Hello, my name is ' + self.name + ' and I am ' + self.age + ' years old!')
    
p1 = Person('Bob', 25)
p1.sayHi() # Prints: Hello, my name is Bob and I am 25 years old!

4 (4 Votes)
0
3.8
5
Lionel Aguero 33605 points

                                    class MyClass(object):
  def __init__(self, x):
    self.x = x

3.8 (5 Votes)
0
3
1
Awgiedawgie 440220 points

                                    class Person:#set name of class to call it 
  def __init__(self, name, age):#func set ver
    self.name = name#set name
    self.age = age#set age
   

    def myfunc(self):#func inside of class 
      print("Hello my name is " + self.name)# code that the func dose

p1 = Person("barry", 50)# setting a ver fo rthe class 
p1.myfunc() #call the func and whitch ver you want it to be with 

3 (1 Votes)
0
0
2
A-312 69370 points

                                    print('hello world')

0
0
3
2
Awgiedawgie 440220 points

                                    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()

3 (2 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
define a class in python class en python creating python classes make a class in python @class method explain python how to create a new class python python class in class example class example python python classes python class method objects and classes in python classes on python defining aclass in python how to create class in python class in pyton how to create a class with c defined methods python defining classes in python class of class python class method python what is python class python use class classes explained python create a class with properties in python how to make classes in python creating class in pyhton class in pythpn creating class python class and objects in python how create a python class python class example code python class tutorial python class method tag class definition in python whats a class in python @ class method python python class example write python class create class object in python make class in python python use class as function what is a class in python what are class methods in python class python explained how to use class in python python class and object python class implementation how to create a class in python Class methods Python python function for class python programming functions and classes pyhton class example class function python creating a class in python python class attributes what are classes in python declaring class in python python class functions python class attributes function class python attributes python classes how to create class object in python how to call a class in python python class structure class in python classes and objects in python define function in class python making classes in python how to use classes python python class methods simple class program in python python class built in functions ptyhon class good python classes example good python classes python create a class python class method define class python what is object in python class creating a python class python class example with methods python class with various functions what is class in python create class python python create class def class python python class type how to define a class in python classes in python how to structure a python script with classes and functions define class in python class code python use of class method in python class in class python what is a class method in python how to make a class in python how to create classes in python make class python python classes attributes creating a class method in python pyton class class python' python classes explained python classes and objects writing class based functions in python class python example class in class in python class in puthon defining class in python python def a class classes python python class attribute python class python objects python working with classes example of class python implement class python how to call class in python
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source