title: Python writing int into file
body: <p>I have a problem with python code and i don't know what to do, because im fairly new in it. </p>
  
  <pre><code>date_now1 = datetime.datetime.now()
  archive_date1 = date_now1.strftime("%d.%m.%Y")
  f1 = open(archive_date1, "r+")
  
  print("What product do you wish to delete ?")
  delate_product = str(input())
  for line in f1.readlines():
      if delate_product in line:
          list = line
          ready_product = list.split()
          quantity_of_product = int(ready_product[1])
          if quantity_of_product == 1:
              del line
              print("Product deleted")
          else:
              print("You have {} amounts of this product. How many do you want to delete ?".format(quantity_of_product))
              x = int(input())
              quantity_of_product = quantity_of_product - x
              temporary = "{}".format(quantity_of_product)
              print(type(temporary))
              f1.write(temporary) in ready_product[1]
  </code></pre>
  
  <p>I get the message   </p>
  
  <pre><code>    f1.write(temporary) in ready_product[1] 
  TypeError: 'in &lt;string&gt;' requires string as left operand, not int
  </code></pre>
  
  <p>When i do <code>print(type())</code> in temporary it says string. I also tried <code>str(quantity_of_product)</code>, but it doesn't work as well. Maybe somebody could give me the idea of what to do, or what to read to get the answer.</p>