Python Forum
Classes: How to Print Specific Attributes
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Classes: How to Print Specific Attributes
#2
It seems to me that if I were to create the following method() in the classStudent, I now have a method within the class to print full name. However I'm not sure how to get the First_Name and Last_Name from the array, in my main, to print from this. I don't know how these are all linked!
def fullName(self):
    self.full_name = self.First_Name + ' ' + self.Last_Name
Reply


Messages In This Thread
RE: Classes: How to Print Specific Attributes - by emerger - Oct-13-2018, 07:52 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question [solved] Classes, assign an attributes to a class not to instances.. SpongeB0B 4 987 May-20-2023, 04:08 PM
Last Post: SpongeB0B
  python print all files which contain specific word in it mg24 5 1,296 Jan-27-2023, 11:20 AM
Last Post: snippsat
  Listing Attributes of Objects & Classes JoeDainton123 4 2,386 Aug-28-2020, 05:27 AM
Last Post: ndc85430
  Getting attributes from a list containing classes midarq 2 2,194 Dec-03-2019, 12:42 AM
Last Post: midarq
  Delete specific lines contain specific words mannyi 2 4,193 Nov-04-2019, 04:50 PM
Last Post: mannyi
  print a word after specific word search evilcode1 8 4,933 Oct-22-2019, 08:08 AM
Last Post: newbieAuggie2019
  Using classes? Can I just use classes to structure code? muteboy 5 5,125 Nov-01-2017, 04:20 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

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