I would like to print the following pattern in Python 3.5 (I\'m new to coding):
*
***
*****
*******
*********
*******
*****
***
*
As pointed out by Martin Evans in his post: https://stackoverflow.com/a/32613884/4779556 a possible solution to the diamond pattern could be:
side = int(input("Please input side length of diamond: ")) for x in list(range(side)) + list(reversed(range(side-1))): print('{: <{w1}}{:*<{w2}}'.format('', '', w1=side-x-1, w2=x*2+1))