title: How to combine these two functions in python
body: <p>I currently have created this code in python. The output is exactly what I want. (If you know of a better way to get it, I am open to hear). I want to know how I can combine my functions triangle and triangle2 into one main function. (My output is a sideways pyramid).</p>
  
  <pre><code>def triangle(n): 
     for x in range(n):
          print ('*'*x)
          n = n - 1 
  
  def triangle2(n): 
     for x2 in range(n):
          print ('*'*n)
          n = n - 1
  
  height = int(input("Enter an odd number greater than 4: "))
  
  triangle(height)
  triangle2(height)
  </code></pre>