cellphone - Celllist = for aline in Cellfile: cell =...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
class Cellphone: def __init__(self,manu,model,price): self.manu = manu self.model = model self.price = price def setManu(self, newManu): self.manu = newManu def getManu(self): return self.manu def setModel(self, newModel): self.model = newModel def getModel(self): return self.model def setPrice(self, newPrice): self.price = newPrice def getPrice(self): return self.price Cellfile = open("phone.txt",'r')
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Celllist = for aline in Cellfile: cell = aline.split() myCell = Cellphone(cell[0],cell[1],cell[2]) Celllist.append(myCell) for aline in Celllist: print(aline.getManu(),aline.getModel(),aline.getPrice()) aline.setManu("hello") aline.setModel("130000sx") aline.setPrice(100000000) for aline in Celllist: print(aline.getManu(),aline.getModel(),aline.getPrice())...
View Full Document

This document was uploaded on 12/14/2010.

Ask a homework question - tutors are online