Programmers learn & share
0 votes
82 views

Problem :

Need solution for bellow problem statement 
print the data members of inventorytag. ex: if item_id is 314 and quantity_remaining is 500, print:
by (6.9k points)   | 82 views

1 Answer

0 votes

Solution :

Please find bellow the solution for your problem statement.

#Printing the data members of InventoryTag. Ex: if item_id is 314 and quantity_remaining is 500, print: ID: 314 Qty: 500

class InventoryTag:

def _init_(self):

self.quantity_remaining = 0

self.ID = 0


 

red_sweater = InventoryTag()

red_sweater.item_id = 314

red_sweater.quantity_remaining = 500

print("qty of inventory remaining")

print("%s is %d" %("ID", 314),end= " ")

print("%s is %d" %("quantity_remaining", 500))

by (36.1k points)  
2,183 questions
2,489 answers
59 comments
241 users