title: Can the count function be used for strings within a function?
body: <p>I am trying to make a function that randomly selects from two options nine times and returns the number of times each option was chosen. However, each time I try to run the code, the count function returns [None].</p>
  <pre><code> import random
  topic=[&quot;Insomnia&quot;,&quot;REM Sleep Disorder&quot;]
  def func():
    print(random.choice(topic))
    print(random.choice(topic))
    print(random.choice(topic))
    print(random.choice(topic))
    print(random.choice(topic))
    print(random.choice(topic))
    print(random.choice(topic))
    print(random.choice(topic))
    print(random.choice(topic))
  
  
    
  x=[func()]
  y=x.count(&quot;Insomnia&quot;)
  print(x)
  </code></pre>
  <p>What am I doing wrong?</p>