Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Class objects
#11
You reference the object, it gives you the object.
Reply
#12
(Aug-26-2020, 07:16 PM)Python_User Wrote: how I can show the print (g1) as FIFA, 2008, €50
Just change a little in my __str__ method.
def __str__(self):
    return f'{self.title}, {self.year}, {self.price}'
Reply
#13
Ok, thanks Thumbs Up
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How can I access objects or widgets from one class in another class? Konstantin23 3 929 Aug-05-2023, 08:13 PM
Last Post: Konstantin23
  How to create and define in one line a 2D list of class objects in Python T2ioTD 1 1,989 Aug-14-2020, 12:37 PM
Last Post: Yoriz
  printing class properties from numpy.ndarrays of objects pjfarley3 2 1,909 Jun-08-2020, 05:30 AM
Last Post: pjfarley3
  Help with lists and class objects AlluminumFoil 15 5,357 Jan-15-2020, 07:32 PM
Last Post: AlluminumFoil
  How to serialize custom class objects in JSON? Exsul1 4 3,432 Sep-23-2019, 08:27 AM
Last Post: wavic
  How do I write class objects to a file in binary mode? Exsul1 7 5,650 Sep-14-2019, 09:33 PM
Last Post: snippsat
  Do objects get their own copy of the class methods? Charles1 1 2,057 Feb-02-2019, 04:40 PM
Last Post: ichabod801
  AttributeError: 'NoneType' object has no attribute 'n' in list of class objects jdrp 4 5,695 Jun-19-2018, 02:44 PM
Last Post: jdrp
  How to check if class instance exists in a list of class instance objects? sonicblind 23 20,007 May-27-2018, 05:44 AM
Last Post: buran
  Class Objects... zowhair 2 2,953 Mar-10-2018, 08:01 AM
Last Post: wavic

Forum Jump:

User Panel Messages

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