Just trying to complete this function.
I need to create a pattern that alternates in python. The input is three character strings and an integer. I cannot use for loops. My particular question is how to alternate characters. I know how to use recursion to call the function, but I don't know what to print before hand.
my current code:
print string 1 * n
printPattern(n-1,string3,string2,string1)
For example:
abcabcabcabc
abcabcabcab
abcabcabca
abcabcabc
abcabcab
abcabca
abcabc
abcab
abca
abc
ab
a
Thanks so much for the help. I am just confused and annoyed.
Aucun commentaire:
Enregistrer un commentaire