Jun-17-2017, 10:02 PM
You pretty much have it, you just need to save the up/down/sames until the end. What I would do is start with an empty list. Each time you are print a word, append it to the list instead:
I would also change your if's for same and up to
>>> count = [1, 2] >>> count.append(5) >>> count [1, 2, 5]Then you need to print the words. You could just loop through them, printing each one with
end = ' '
, or you could join them and print once:>>> ' '.join(['spam', 'spam', 'eggs']) 'spam spam eggs'
I would also change your if's for same and up to
elif
(short for else if). Then they will only be checked if none of the previous conditions have been met. This is more efficient, and is necessary if you conditions overlap and you only want one to execute.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures