I just started Python 2.7 very recently, but I'm stuck at this a problem:
Make a program that prints an "M" pattern of asterisks. The user shall input the height of the pattern.
Here's the picture of the problem:
h=raw_input("Enter the height of MStar here:")
h=int(h)
for row in range(0,(h-1)/2):
for column in range(row+1):
print "*",
print
for row in range((h-1)/2,h):
for column in range(h):
print "^",
print
It is also suggested that I can do two loops for the pattern because it can be seen as two parts, the upper one with the stars and spaces, and the second part that looks like a rectangle which I've done. I need some help with my code, because I really don't know how I can add the second triangle, I've can only make the first.