class Person:
name = ""
height = 0
class Person:
name = ""
height = 0
MAX = 3
p = []
for x in range(MAX):
per = Person()
print "Enter person's name: ",
per.name = raw_input()
print "Enter height in inches: ",
per.height = int(raw_input())
p.append(per)
print "Outputting person data\n";
print "======================\n";
for x in range(MAX):
print "Person ", x + 1, "'s name is ", p[x].name, " and height is ", p[x].height
class Person:
name = ""
height = 0
MAX = 3
p1 = Person()
print "The person's name is ", p1.name, " and height is ", p1.height
class Person:
def __init__(self):
self.name = "no name assigned"
self.height = -1
MAX = 3
p1 = Person()
print "The person's name is ", p1.name, " and height is ", p1.height
class Person:
def __init__(self, s="no name assigned", h=-1):
self.name = s
self.height = h
MAX = 3
print "Enter a person's name: ",
s = raw_input()
print "Enter height in inches: ",
h = int(raw_input())
p1 = Person(s, h)
print "The person's name is ", p1.name, " and height is ", p1.height
class Person:
def __init__(self, s="no name assigned", h=-1):
self.name = s
self.height = h
MAX = 3
print "Enter a person's name: ",
s = raw_input()
print "Enter height in inches: ",
h = int(raw_input())
p1 = Person(s, h)
print "The person's name is ", p1.name, " and height is ", p1.height
class Person:
name = ""
height = ""
def setValues(self, pers):
print "Enter person's name: ",
pers.name = raw_input()
print "Enter height in inches: ",
pers.height = int(raw_input())
def getValues(self, pers):
print "Person's name is ", pers.name, " height is ", pers.height
p1 = Person()
p1.setValues(p1)
print "Outputting person data"
print "======================"
p1.getValues(p1)
class Date:
month = 0
day = 0
year = 0
class Person:
name = ""
height = 0
bDay = Date()
def setValues(self, pers):
print "Enter person's name: ",
pers.name = raw_input()
print "Enter height in inches: ",
pers.height = int(raw_input())
print "Enter birthdate"
pers.bDay.month = int(raw_input("Month: "))
pers.bDay.day = int(raw_input("Day: "))
pers.bDay.year = int(raw_input("Year: "))
def getValues(self, pers):
print "Person's name: ", pers.name
print "Person's height", pers.height
print "Person's birthday in mm/dd/yyyy format is: ", pers.bDay.month, pers.bDay.day, pers.bDay.year
p1 = Person()
p1.setValues(p1)
print "Outputting person data"
print "======================"
p1.getValues(p1)
class Person:
name = ""
height = ""
def setValues(self, pers):
print "Enter person's name: ",
pers.name = raw_input()
print "Enter height in inches: ",
pers.height = int(raw_input())
def getValues(self, pers):
print "Person's name is ", pers.name, " height is ", pers.height
p1 = Person()
p1.setValues(p1)
print "Outputting person data"
print "======================"
p1.getValues(p1)
class Person:
name = ""
height = ""
def setValues(self, pers):
print "Enter person's name: ",
pers.name = raw_input()
print "Enter height in inches: ",
pers.height = int(raw_input())
def getValues(self):
print "Person's name is ", self.getName(), " height is ", self.getHeight()
def getName(self):
return self.name
def getHeight(self):
return self.height
p1 = Person()
p1.setValues(p1)
print "Outputting person data"
print "======================"
p1.getValues()