Created
September 15, 2018 18:54
-
-
Save nngogol/70f5e3b6b55bef4db7c62bfe2461f638 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s, sp, padd='*', 2, 45 | |
for i in range(5): | |
[print(' '*(padd-i), s*i, s*i, ' '*(padd-i), ' '*(padd-i), s*i, s*i, ' '*(padd-i), sep='') for i in range(1, 20, sp)] | |
[print(' '*(padd-i), s*i, s*i, ' '*(padd-i), ' '*(padd-i), s*i, s*i, ' '*(padd-i), sep='') for i in reversed(range(1, 20, sp))] | |
print('\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
[print(' '*(20-i), 's'*i, 's'i, ' '(20-i), sep='') for i in range(1, 20, 2)]
тоже самое, только дописал reversed
[print(' '*(20-i), 's'*i, 's'i, ' '(20-i), sep='') for i in reversed(range(1, 20, 2))]
альтернатива: изменить range
[print(' '*(20-i), 's'*i, 's'i, ' '(20-i), sep='') for i in range(20, 1, -2)]