About 2,550,000 results
Open links in new tab
  1. Making triangles in Python - Stack Overflow

    Sep 18, 2018 · Below is a code I made in Python for our lab activity which makes a triangle.

  2. How to print a Triangle Pyramid pattern using a for loop in Python ...

    How to print a Triangle Pyramid pattern using a for loop in Python? Asked 6 years, 10 months ago Modified 2 years, 8 months ago Viewed 25k times

  3. How to make a triangle of x's in python? - Stack Overflow

    Dude It's super easy: def triangle(n): for i in range(1, n +1): print ' ' * (n - i) + 'x' * i Or even: def triangle(n): for i in range(1, n +1): print ('x' * i).rjust(n, ' ') output for triangle(5): x xx xxx xxxx …

  4. python - Extract upper or lower triangular part of a numpy matrix ...

    Additionally, there are the functions np.triu_indices, np.tril_indices, np.triu_indices_from, and np.tril_indices_from to generate indices to index the upper or lower triangle with. (The "from" …

  5. python - Sierpinski triangle recursion using turtle graphics - Stack ...

    Oct 17, 2016 · I am trying to write a program that draws a sierpinski tree with python using turtle. Here is my idea: import turtle def draw_sierpinski(length,depth): window = turtle.Screen() t = …

  6. Plotting only upper/lower triangle of a heatmap - Stack Overflow

    2 With seaborn, matplotlib and numpy, a quick solution is: import matplotlib.pyplot as plt import seaborn as sns # Say your matrix object (e.g. np.array) is corr_mat # Get the upper triangle …

  7. Pascal's Triangle for Python - Stack Overflow

    Jun 7, 2014 · As a learning experience for Python, I am trying to code my own version of Pascal's triangle. It took me a few hours (as I am just starting), but I came out with this code: …

  8. Asterisks Triangle in Python - Stack Overflow

    Nov 7, 2012 · I am trying to create a program that allows me to make a "pyramid" or "triangle" using asterisks, in the Python program. I've already started the code, but can't seem to figure it …

  9. image - how to draw a triangle with PIL? - Stack Overflow

    Jul 17, 2018 · how to draw a triangle with PIL? Asked 7 years, 3 months ago Modified 7 years, 3 months ago Viewed 11k times

  10. How to determine if a point is in a 2D triangle? [closed]

    Jan 12, 2010 · It's worth noting that any methods discussed here are valid in 3D space as well. They just need to be preceded by a coordinate transformation (and an appropriate projection …