title: PYTHON : How do I make my program produce a file with a random file name
body: <pre><code>import time
  
  a = 0
  amount = 1
  while a &lt; 100:
      userfile = 'random{}'.format(amount)
      file = open(userfile, 'a')
      amount += 1
      time.sleep(0.2)
      print(userfile)
      a += 1
  </code></pre>
  
  <p>I've made a program that creates files with a fixed file name. I'm trying to make it so the file name is a randomly generated set of letters but I don't know quite how to apply the random function to it. </p>