Good Morning
07:32 am

Sponsor Area

Sponsor Area

Question is

Find and write the output of the following Python code :
class ITEM:
	def __init__(self,I=101,N='Pen',Q=10): #constructor
		self.Ino=I
		self.IName=N
		self.Qty=int(Q);

	def Buy(self,Q):
		self.Qty = self.Qty + Q

	def Sell(self,Q):
		self.Qty -= Q

	def ShowStock(self):
		print self.Ino,':',self.IName,'#',self.Qty

I1=ITEM()
I2=ITEM(100,'Eraser',100)
I3=ITEM(102,'Sharpener')
I1.Buy(10)
I2.Sell(25)
I3.Buy(75)
I3.ShowStock()
I1.ShowStock()
I2.ShowStock()

Mock Test Series

Sponsor Area

Sponsor Area

NCERT Book Store

NCERT Sample Papers

Entrance Exams Preparation