I am required to use nested for loops and print(\'*\', end=\' \') to create the pattern shown here:
And here is my code. I have figured out the first t
The function:
def arrow(my_char, max_length):
for i in range(max_length*2):
if i <= max_length:
print(my_char*i)
if i > max_length:
print(my_char*(max_length*2-i))
The main():
def main():
print(arrow('*', 8))
if __name__ == "__main__":
main()
Output:
*
**
***
****
*****
******
*******
********
*******
******
*****
****
***
**
*