Python Forum
How to write a code to get this kind of output in IDLE
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to write a code to get this kind of output in IDLE
#6
Usually the __repr__ method returns the what you run to create the instance of that class.

def __repr__(self):
    return f'Dog({self.name}, {self.age}, {self.gender})'
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Messages In This Thread
RE: How to write a code to get this kind of output in IDLE - by wavic - Oct-28-2018, 07:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  UART write binary code trix 3 238 Apr-28-2024, 04:57 PM
Last Post: deanhystad
  write code that resides in parent directory franklin97355 3 447 Apr-14-2024, 02:03 AM
Last Post: franklin97355
  Why can I not see the code correctly in Python IDLE.? Trump 8 741 Apr-04-2024, 07:47 AM
Last Post: jonesphedra
  problem in output of a snippet code akbarza 2 409 Feb-28-2024, 07:15 PM
Last Post: deanhystad
  needing some help to write some code for a game calculator rymdaksel 1 444 Jan-02-2024, 09:56 AM
Last Post: deanhystad
  Reading data from excel file –> process it >>then write to another excel output file Jennifer_Jone 0 1,132 Mar-14-2023, 07:59 PM
Last Post: Jennifer_Jone
  I cannot able to see output of this code ted 1 772 Feb-22-2023, 09:43 PM
Last Post: deanhystad
  What kind of list is this? jesse68 2 1,162 Jun-29-2022, 05:02 PM
Last Post: rob101
  why I dont get any output from this code William369 2 1,147 Jun-23-2022, 09:18 PM
Last Post: William369
  How can I organize my code according to output that I want ilknurg 1 1,192 Mar-11-2022, 09:24 AM
Last Post: perfringo

Forum Jump:

User Panel Messages

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