djet Posted July 24, 2008 Share Posted July 24, 2008 This was my first Python developement: Just stick it in your own script then call it with letters() def letters(n=0,s="|", w = 0): """Call this with letters()""" print s if n < 20 and w == 0: return letters(n+1,s+"|") elif n == 20 and w == 0: return letters(n,s,w = 1) elif w == 1 and n>0: return letters(n-1,s[:-1],w) elif n==0: return letters(n,s,w=0) Link to comment Share on other sites More sharing options...
Recommended Posts