continue
Until the last problem, I used to use one liner, In my current situation, it doesn't fit or has been executed Since it was not organized, I wrote it in a file and executed it as follows. (Maybe the real answer is more nesting, I think I can write it well, Cannot m (_ _) m)
test.py
#!/usr/bin/env python
#coding:utf-8
str = "####"
for i in range(1,5,1):
slice = str[:i]
print(slice)
for i in range(3,0,-1):
slice = str[:i]
print(slice)
・ ・ ・
$ python test.py
#
##
###
####
###
##
#
I feel very delicate.
Recommended Posts