1
print("Store Room Stock Category")

print("")

print("")    

Stockmachinary1 = input("Enter the stock material name:")

Stockmachinary1price=int(input("Enter the stock material price:"))

Stockmachinary2=input("Enter the stock material name:")

Stockmachinary2price=int(input("Enter the stock material price:"))

Stockmachinary3=input("Enter the stock material name:")

Stockmachinary3price=int(input("Enter the stock material price:"))                             



  Totalstockprice=Stockmachinary1price+Stockmachinary1price+Stockmachinary3price

import pandas as pd 

stock = pd.DataFrame({"stock":[Stockmachinary1,Stockmachinary2,Stockmachinary3,"totalcoststock"],\
                          "price":[Stockmachinary1price,Stockmachinary2price,Stockmachinary1price,Totalstockprice]})

stock=stock[["stock","price"]]

stock

Totalstockprice
Uma Madhavi
  • 4,851
  • 5
  • 38
  • 73
Dhanvanth
  • 63
  • 1
  • 8
  • 3
    There's no question in there, just code. – Barmar Mar 06 '18 at 06:28
  • Welcome to StackOverflow! Please read the info about [how to ask a good question](https://stackoverflow.com/help/how-to-ask) and [how to give a reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). This will make it much easier for others to help you. – Aditi Mar 06 '18 at 06:32

1 Answers1

1

If you talking about not write too many codes, I think you should use loops, and for-loop like below:

print("Store Room Stock Category")
print("")
print("")
StockmachinaryNames = []
StockmachinaryPrice = []
counts = int(input("Enter the stock material you want input:"))
for i in range(counts):
        Name = input("Enter the stock material name:")
        Price=int(input("Enter the stock material price:"))
        StockmachinaryNames.append(Name)
        StockmachinaryPrice.append(Price)
TotalstockPrice = sum(StockmachinaryPrice)
StockmachinaryNames.append("totalcoststock")
StockmachinaryPrice.append(TotalstockPrice)

import pandas as pd

stock = pd.DataFrame({"stock":StockmachinaryNames,\
                      "price":StockmachinaryPrice})
stock=stock[["stock","price"]]
print(stock)

print(TotalstockPrice)

But if you talking about bach data input, I think you may need csv or other file format for input. And pandas work well with it. there is the help page:

http://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_csv.html