You are viewing a single comment's thread. Return to all comments →
Very elegant solution!
I was trying to do something like you but end up with another way to do it.
import string alpha = string.ascii_lowercase num = int(input()) def srange(N): return list(range(N))+list(range(N-2,-1,-1)) for i in srange(num): print('-'.join([alpha[num-j-1] for j in srange(i+1)]).center(4*(num-1)+1,'-'))
Seems like cookies are disabled on this browser, please enable them to open this website
Alphabet Rangoli
You are viewing a single comment's thread. Return to all comments →
Very elegant solution!
I was trying to do something like you but end up with another way to do it.