Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # b_nth_diamond_recursive.py
- def nth_diamond(nth,i=0,s=[]):
- t = ' '+' '*(nth-i)+'* '*i
- s.append(t)
- if i < nth:
- nth_diamond(nth,i+1)
- s = s[:-1]+s[::-1]
- return '\n'.join(s)
- 0
- print nth_diamond(5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement