Jump to content

Fun Little Python Code


1 post in this topic

Recommended Posts

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

 Share

×
×
  • Create New...