Python Forum
how do you define Class in python ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how do you define Class in python ?
#5
Thanks for the reply.

you said
Quote: So in Python 3 there is no ().
() only come in play when it's Inheritance.

Please look at this code below. There is no inheritance here.

class Mario():
    
    def move(self):
        print('I am moving!')



bm = Mario()
bm.move()
Output:
--------
I am moving!

I am using Python interpreter 3.4

I am getting confused now ..does class Mario() : and class Mario: is same thing in Python 3 ?

comments please. what I'm missing ?
Reply


Messages In This Thread
how do you define Class in python ? - by volcano - Mar-03-2018, 06:57 PM
RE: how do you define Class in python ? - by volcano - Mar-04-2018, 05:27 AM
RE: how do you define Class in python ? - by wavic - Mar-04-2018, 05:31 AM
RE: how do you define Class in python ? - by nilamo - Apr-09-2018, 07:24 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to use a variable in Python (2.x) to define decimal part? MDRI 4 2,376 May-07-2021, 12:39 AM
Last Post: MDRI
  How to define a variable in Python that points to or is a reference to a list member JeffDelmas 4 2,720 Feb-28-2021, 10:38 PM
Last Post: JeffDelmas
  How to create and define in one line a 2D list of class objects in Python T2ioTD 1 2,087 Aug-14-2020, 12:37 PM
Last Post: Yoriz
  dynamically define class's michavardy 1 2,124 Feb-26-2019, 04:20 PM
Last Post: buran
  Converting c++ class to python class panoss 12 11,968 Jul-23-2017, 01:16 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020