Dennis Lee Bieber
2/7/2008 6:43:00 PM
On Thu, 07 Feb 2008 13:53:48 +0100, Guido van Brakel <guidovb1@invalid>
declaimed the following in comp.lang.python:
>
> If i enter a center digit like 5 for example i need to create two
No idea of what "center digit" means (to me it implies a digit in
the middle of a multi-digit number: 123, 73837, 04377 [2, 8, 3,
respectively]).
> 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.
>
Attempting to paraphrase, you are supposed to produce an ASCII art
(okay, maybe ISO-Latin-1, or some other set -- but * is pretty common in
all) box whose sides are the length (call it "n") entered.
You need only a few things...
Line 1 is "n" copies of *
Lines 2..n-1 are *, 2..n-1 copies of space, *
Line n is "n" copies of *
Brute force mode (not optimized) would be a loop for line 1; a loop
for lines 2..n-1 that contains a loop for spacing the *, and a final
loop for line n.
Python is high-level enough that it can be done with one loop
containing an if/else block.
--
Wulfraed Dennis Lee Bieber KD6MOG
wlfraed@ix.netcom.com wulfraed@bestiaria.com
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: web-asst@bestiaria.com)
HTTP://www.bestiaria.com/