beginners help
Steve Holden
steve at holdenweb.com
Thu Feb 7 17:56:08 EST 2008
Tim Chase wrote:
>> If i enter a center digit like 5 for example i need to create two
>> vertical and horzitonal rows that looks like this. If i enter 6 it shows
>> 6 six starts. How can i do this, because i don't have any clue.
>>
>> *****
>> * *
>> * *
>> * *
>> *****
>
> Well we start by introducing the neophite programmer to unit-testing:
>
> import unittest
>
> class Tester(unittest.TestCase):
> def testFive(self):
> """ digit like 5 for example i need to
> create two vertical and horzitonal
> rows that looks like this
> *****
> * *
> * *
> * *
> *****
> """
> assert five() == "*****\n* *\n* *\n* *\n*****"
>
> def testSix(self):
> """If i enter 6 it shows 6 six starts"""
> assert six() == "start" * 6
>
> def five():
> return "*****\n* *\n* *\n* *\n*****"
>
> def six():
> return "start" * 6
>
> if __name__ == "__main__":
> unittest.main()
>
>
> works for me... ;)
I think you've scared him away, Tim!
regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
More information about the Python-list
mailing list