On Wed, Dec 12, 2012 at 10:22 AM,  <siimnur...@gmail.com> wrote:
> Well, I did some modifications and got a hollow square, but the columns 
> aren't perfectly aligned with the rows (at least if input is 5. Thanks for 
> the help :)
>
> rows = int(input())
> s1="* "*rows
> s2="*"+(rows-2)*" "+"*"
> print(s1)
> for s in range(rows-2):
>     print(s2)
> print(s1)

The (rows-2)*" " in s2 is only enough spaces to account for the
(rows-2) inner * characters in s1.  You also need additional spaces in
s2 to match up with for the (rows-1) space characters in between the *
characters in s1.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to