Skip to content

Instantly share code, notes, and snippets.

@fzmaster
Created December 21, 2010 05:02
Show Gist options
  • Save fzmaster/749519 to your computer and use it in GitHub Desktop.
Save fzmaster/749519 to your computer and use it in GitHub Desktop.
Problema: NASA Countdown
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