• Register
0 votes

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:
6 5 3
6,930 points

Please log in or register to answer this question.

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))

9 7 4
38,600 points

Related questions

0 votes
1 answer 122 views
As I analyzed it I have arrived on a conclusion but I don't think that its gonna work so I would appreciate if you correct it. If I want to enter a number again to be added on the sum variable what can be the decision ? Start Initialize counter = 0 , sum = 0 Input N N % 3 == ... else if counter != N { If true , loop back to " Input N " else print sum } else , N not divisible by 3 . Print sum End
asked Oct 25, 2020 psandprop 2.4k points
0 votes
1 answer 15 views
Briefly explain in java to how one should print the matrix with a simple example.
asked Dec 21, 2020 ZarinaShaik 320 points
1 vote
1 answer 26 views
Problem: Hello Guys, I am a new member of this forum. I recently started learning computer programming and I started with Python. One of my friends recommended this forum, and here I am! Anyway, I have come with a very fundamental question and its a must to answer. What is stderr and how do you usee it in Python? Thanks for your answers. I must recognize your help.
asked Aug 6, 2020 adamSw 11.3k points
1 vote
1 answer 42 views
Problem: Hello Kodlogs, I am here with a problem. This could be a simple problem for you, guys, but it’s driving me crazy. I am in a situation that needs to print multiple values in a single line. Let me describe it in my words. Say, have some integer ... value in a different line and there is no option to concatenate them. Could you please help me out? Thanks for your concern and kind help.
asked Jun 2, 2020 adamSw 11.3k points
0 votes
1 answer 1.7K views
Problems : Assign the size of userInput to stringSize. Ex: if userInput = "Hello", output is: Size of userInput: 5 #include <stdio.h> #include <string.h> int main(void) { char userInputArray[50] = ""; int stringInputSize = 0; strcpy(userInputArray, "Hello"); /* Your solution starts here */ printf("Size of userInputArray: %d\n", stringInputSize); return 0; }
asked Dec 18, 2019 alecxe 7.5k points
0 votes
1 answer 12 views
0 votes
1 answer 6 views
Problem: Hello programmers! I am a beginner and I have got an assginement in which I have to write a program in Java that will take a number from user as input and will check whether the user entered an even number or an odd number. The program is to be written in ... and I have no idea how to check if a number is even or odd using a program. Any help from you would be much appreciated. Thanks
asked Nov 27, 2020 Code Learner 5.5k points
0 votes
1 answer 447 views
The code below is based on code.activestate.com/recipes/413614/ However, the key point of the recipe - that it provides a way to break out of the iteration on an iterator if the iterator is empty - doesn't seem to work here, instead behaving ... next_choice = choice_iterator.next() except StopIteration: print "No matches. Exiting..." sys.exit() else: choice_iterator = itertools.chain([next_choi
asked Oct 28, 2020 psandprop 2.4k points
1 vote
1 answer 41 views
Probelm: I have 4 values that are: a = 9 b = 13.58 c = "allforallinall" d = [9, 13, 99] For those four values I tried to print which type of a variable they are, So I wrote this python program: a = 9 b = 13.58 c = "allforallinall" d = [9, 13, ... If this is not the way to print the type of a variable which is and how to print the type of a variable using a python program. Thanks in advance.
asked May 17, 2020 samhaz 5k points
0 votes
1 answer 91 views
I am finding difficult to find the solution for this problem: error 500: javax.servlet.servletexception: filter [hsbc filter]: filter is unavailable. Can anyone help?
asked Jul 24, 2020 James Martin 2.2k points