John works in the customer service department. He is assigned a task where he has to store the details of an item purchased by a customer and produce a bill that holds all the details about the item. John had to manage all the records manually and produce a handwritten bill. It was a very time-consuming task, seeing this his manager reaches the development team to build a code to make john's work easier. imagine you are working in the development team and this task is assigned to you. Write a code that takes all the details of the item and produce the bill with the same details. Create a class Item in ‘Item.py’ with the following attributes. Data type Attribute str item_id str item_name str company_name int price Use _init_() constructor to initialize the variables with respect to class. Method Description display(self) : This method will print the details of the item. Get the input and create an object for ‘Item’ in ‘Main.py’ Input format: The first line of input is an integer indicating item id Followed by the strings indicating item name and company name respectively Followed by the integer indicating the price of the item. Output format: The output should display the details entered by the user. Note: Print the details in Item class and not in the Main class. Refer to sample output for the formatting specifications. Sample Input: AC8142017 Water Bottle Tupperware 280 Sample Output: Item Id: AC8142017 Item Name: Water Bottle Company Name: Tupperware Price of Item: 280 Rs
John works in the customer service department. He is assigned a task where he has to store the details of an item purchased by a customer and produce a bill that holds all the details about the item. John had to manage all the records manually and produce a handwritten bill. It was a very time-consuming task, seeing this his manager reaches the development team to build a code to make john's work easier. imagine you are working in the development team and this task is assigned to you. Write a code that takes all the details of the item and produce the bill with the same details.
Create a class Item in ‘Item.py’ with the following attributes.
Data type Attribute
str item_id
str item_name
str company_name
int price
Use _init_() constructor to initialize the variables with respect to class.
Method Description
display(self) :
This method will print the details of the item.
Get the input and create an object for ‘Item’ in ‘Main.py’
Input format:
The first line of input is an integer indicating item id
Followed by the strings indicating item name and company name respectively
Followed by the integer indicating the price of the item.
Output format:
The output should display the details entered by the user.
Note: Print the details in Item class and not in the Main class.
Refer to sample output for the formatting specifications.
Sample Input:
AC8142017
Water Bottle
Tupperware
280
Sample Output:
Item Id: AC8142017
Item Name: Water Bottle
Company Name: Tupperware
Price of Item: 280 Rs
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images