PyTricks icon indicating copy to clipboard operation
PyTricks copied to clipboard

patternify

Open satyasahoo210 opened this issue 6 years ago • 0 comments

traditional way

'''
Printing the pattern
*
**
***
****
'''
for i in range(1,4+1):
    for j in range(i):
       print('*', end='')
    print()

hack

print('\n'.join(['*' * i for i in range(1, 4+1)])

satyasahoo210 avatar Aug 29 '19 14:08 satyasahoo210