3 ms·
Parameterized! def d(n): return '\n'.join(int(max((n-1)/2-i,i-n/2))*' '+(min(i,n-1-i)*2+1)*'*' for i in xrange(0,n))
by paulbaumgart 16y ago
Parameterized!
def d(n): return '\n'.join(int(max((n-1)/2-i,i-n/2))*' '+(min(i,n-1-i)*2+1)*'*' for i in xrange(0,n))
- BoppreH 16y agoI have made a version of that myself just before posting here, but I made n be width, not the height. Still an interesting solution.