title: Triangle made out of 'abc' [python]
body: <p>i have a problem with this code, what it is supposed to do is:</p>
  
  <pre><code>    a
     b c
    a b c
   a b c a
  b c a b c
  </code></pre>
  
  <p>I want to create a function pyramid(n), where n is number of rows. And I want to make it out of 'abc'. I can create triangle looking like this, but without a changing letter. I was thinking of some for loop from 1 to 3, but can't come up with something where it wouldn't be doing this:</p>
  
  <pre><code>    a
     b b
    c c c
   a a a a
  b b b b b
  </code></pre>
  
  <p>Or printing thinks multiple times (as it would be for loop (for rows) in for loop (from 1 to 3, for changing the letter)).</p>
  
  <p>Those are my attempts:</p>
  
  <pre><code>def pyramid(n):
      word = 'abc'
      for i in range(1, n+1):
          print (" "*(n-i), " ".join(word[1]*i))
  
      """ Just for help, to see how it works, if I can't come up with something
      while looking at it. (n-1) would be (n-i) in loop.
  
      print(" "*(n-1),'a')
      print(" "*(n-2),'b','c')
      print(" "*(n-3),'a','b','c')
      print(" "*(n-4),'a','b','c','a')
      print(" "*(n-5),'b','c','a','b','c')
  
      """
  
  """ Corectly looking solution, but just for one number.    
  def pyramid(n):
      for i in range(1, n+1):
          print (" "*(n-i), " ".join(str(n)*i))
  """
  </code></pre>