title: TCS DCA question : Mini grocery store in python
body: <pre><code>import pandas as pd
  id_num=[101,102,103,104]
  price = [40,50,60,70] 
  stock = [10,14,14,13] 
  new = pd.DataFrame(
      {'id_num':id_num,
       'price':price,
       'stock':stock
       })
  try:
      inp_num=int(input(&quot;enter the id number:&quot;)) 
      qua = int(input(&quot;enter the quantity:&quot;)) 
  except ValueError:
      print(&quot;Invalid&quot;)
  
  if([new['id_num']==inp_num]):
      total = price*qua
      print(total)
  </code></pre>
  <blockquote>
  <p>Explanation</p>
  <p><strong>Program : enter the id and stock value that customer wants to buy and calculate the price according the quantity</strong> Example input : 1 &gt;
  id = 101
  quantity = 5 output :
  total price = 200  2&gt; id = 103     quantity = 20 output ;    out of stock&quot;</p>
  </blockquote>