# names.py -- 080515 (sjd)
#   Simple class to manipulate names with OOP definitions
from random import choice
class Name():       # start class definition
    
    first = ""          # instance variables
    last = ""
    delta = choice(("Flounder", "Pinto", "Stain", "Penguin", "Floppy",
                   "Stretch", "Oklahoma", "Shoehorn", "Porpise"))
    def __init__(self, first, last):            # a constructor
        self.first = first
        self.last = last
    def getFirst(self):                         # an accessor method
        return self.first
    def getLast(self):                          # another accessor
        return self.last
    def getDelta(self):
        return self.delta
    def setFirst(self, newFirst):               # a mutator method
        self.first = newFirst
    def setLast(self, newLast):                 # another mutator
        self.last = Newlast
    def lastNameFirst(self):                    # a manipulator method
        return self.last + ", " + self.first        # concatenation
    def backwards(self):                        # another manipulator
        s = self.first + " " + self.last
        sb = ""                                     # example of 'accumulator
        for k in range(len(s) - 1, -1, -1):         #   pattern', concatenating
            sb += s[k]                              #   chars to accumulator
        return sb
def main():             # the "client"
    yrFirstName = raw_input("What is your first name? ")
    yrLastName = raw_input("What is your last name?  ")
    yourName = Name(yrFirstName, yrLastName)        #instantiate a Name object
    print "Hello,", yourName.getFirst()             # using dot notation to
                                                    #   invoke a method
    print
    print "Your Army name is:      ", yourName.lastNameFirst()
    print "Your name backwards is: ", yourName.backwards()
    print "Your Delta name is:     ", yourName.getDelta()
main()