Overthinking Fizzbuzz with Monoids
Python can produce extensible solutions!  It can!<p>(Edit from sillier comment.)<p><pre><code>  def fizzbuzz(n):
      outstring = &quot;&quot;
      outputs = {5: &quot;buzz&quot;, 3: &quot;fizz&quot;, 7: &quot;bar&quot;}
      for x in sorted(outputs.keys()):
          if n % x == 0:
              outstring += outputs[x]
      if outstring:
          return outstring
      return n
</code></pre>
Then all you gotta do to add more prime numbers is stick them in the dict (or factorize composite numbers you want to put in).  Which is more idiomatic in python than endless if elif elif elif elif.