[Solved] How to make a triangle of x’s in python?
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 xxxxx Dont just copy this code without comprehending it, … Read more