Created
August 25, 2012 05:39
-
-
Save darkowlzz/3461285 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
l = 'XYZ' | |
#def stringOccurrences(int n, String str): | |
def pandovan(n): | |
p = [] | |
for i in range(0,n): | |
if i<3: | |
p.append(l[i]) | |
else: | |
p.append(p[i-2] + p[i-3]) | |
str = p[n-2] + p[n-3] | |
print str | |
pandovan(6) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment