IDLE.
def __init__(self, name, breed, owner):
def get_name(self):
def get_breed(self):
def get_owner(self):
def get_score(self):
def set_score(self, score):
def __str__(self):
def __gt__(self, other):
def __lt__(self, other):
def __eq__(self, other):
def __ne__(self, other):
d1 = Dog("Frank", "Doberman", "Malcom Smith")
print("name: ", d1.get_name())
print("breed: ", d1.get_breed())
print("owner: ", d1.get_owner())
print("score: ", d1.get_score())
d1.set_score(95)
print("score: ", d1.get_score())
print(d1)
d2 = Dog("Rover", "German Shepard", "Bill Busby")
print(d2)
d2.set_score(82)
print("d1 > d2 :", d1 > d2)
print("d1 < d2 :", d1 < d2)
print("d1 == d2 :", d1 == d2)
print("d1 != d2 :", d1 != d2)
name: Frank breed: Doberman owner: Malcom Smith score: 0 score: 95 Frank Doberman Malcom Smith Rover German Shepard Bill Busby d1 > d2 : True d1 < d2 : False d1 == d2 : False d1 != d2 : True
True
if the score of the object is greater than the score of the other
object. True
if the score of the object is less than the score of the other
object. True
if the score of the object is equal the score of the other object. True
if the score of the object is not equal the score of the other
object. name: Frank breed: Doberman owner: Malcom Smith score: 0 score: 95 Frank Doberman Malcom Smith Rover German Shepard Bill Busby d1 > d2 : True d1 < d2 : False d1 == d2 : False d1 != d2 : True
cd it117/hw/hw10
hw10.py
name: Frank breed: Doberman owner: Malcom Smith score: 0 score: 95 Frank Doberman Malcom Smith Rover German Shepard Bill Busby d1 > d2 : True d1 < d2 : False d1 == d2 : False d1 != d2 : True
Copyright © 2020 Glenn Hoffman. All rights reserved. May not be reproduced without permission.