Created
December 21, 2010 05:02
-
-
Save fzmaster/749519 to your computer and use it in GitHub Desktop.
Problema: NASA Countdown
This file contains hidden or 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
import unittest | |
def nasa(tempo): | |
""" | |
Autor: fzmaster | |
Data: 21/12/2010 | |
Problema: NASA Countdown | |
http://codingkata.org/katas/unit/nasa-countdown | |
""" | |
return ' '.join(map(str, range(tempo,-1,-1))) | |
class NasaTestCase(unittest.TestCase): | |
def test_Nasa_3(self): | |
assert nasa(3) == '3 2 1 0' | |
def test_Nasa_5(self): | |
assert nasa(5) == '5 4 3 2 1 0' | |
def test_Nasa_15(self): | |
assert nasa(15) == '15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0' | |
if __name__ == '__main__': | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment