title: How to compare two requests values and print if new values found
body: <p>Im currently coding a comprehension where I check for fruits in KG (as example) that are in stock in a webshop. The values can be between 1-10KG and that some of the values (KG) might not be in stock but could be restocked after a while.</p>
  <p>What I have been trying to do is to print out if we find a restock. We should print it out and say that &quot;There is a restock&quot; and then continue to compere to see if there is more restock.</p>
  <p>As for now I have done a mock-up data of what it could look like:</p>
  <pre><code>import random
  import time
  
  &quot;&quot;&quot; # Mock-up of a requests values that is being scraped&quot;&quot;&quot;
  firstReq = []
  for _ in range(random.randint(1, 5)):
      firstReq.append(random.randint(1, 10))
  
  while True:
      &quot;&quot;&quot; # Mock-up of a requests values that is being scraped&quot;&quot;&quot;
      newReq = []  # I have created an example for random values - The meaning here is that I will later on scrape values through requests.
      for _ in range(random.randint(1, 5)):
          newReq.append(random.randint(1, 10))
  
      if len(newReq) &gt; len(firstReq):
          print(&quot;New value has been uploaded to the page&quot;)
          newReq = firstReq
  
      else:
          print(&quot;There is more values in firstReq than in newReq&quot;)
          time.sleep(2)
          newReq = firstReq
  </code></pre>
  <p>However my concern is that I dont think comparing the length of found KG on the website could be a good way because an example could be if 2KG is already in stock. That means we have already 1 In-stock and we continue to see if there is new restock coming. (We don't care if it gets less in stock, only when restocked however!) and lets say that 2KG gets sold out but a 4KG gets restock, with the code I have done, this will still think there is 1 In-stock and I will then miss the 4KG restock.</p>
  <p>I wonder how I can be able to print out whenever there has happend a restock for a value?</p>