Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #34702

Re: Hollow square program

Newsgroups comp.lang.python
Date 2012-12-12 09:22 -0800
References <1aa414f0-1e4c-424b-abc6-8e681631788b@googlegroups.com> <mailman.779.1355331602.29569.python-list@python.org>
Subject Re: Hollow square program
From siimnurges@gmail.com
Message-ID <mailman.781.1355332959.29569.python-list@python.org> (permalink)

Show all headers | View raw


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)

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Hollow square program siimnurges@gmail.com - 2012-12-12 08:48 -0800
  Re: Hollow square program Chris Angelico <rosuav@gmail.com> - 2012-12-13 03:59 +1100
    Re: Hollow square program siimnurges@gmail.com - 2012-12-12 09:22 -0800
      Re: Hollow square program Ian Kelly <ian.g.kelly@gmail.com> - 2012-12-12 10:35 -0700
      Re: Hollow square program Peter Otten <__peter__@web.de> - 2012-12-12 18:44 +0100
        Re: Hollow square program siimnurges@gmail.com - 2012-12-12 09:52 -0800
          Re: Hollow square program Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-12-12 23:47 +0000
            Re: Hollow square program Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-13 00:12 +0000
        Re: Hollow square program siimnurges@gmail.com - 2012-12-12 09:52 -0800
    Re: Hollow square program siimnurges@gmail.com - 2012-12-12 09:22 -0800
  Re: Hollow square program Mitya Sirenef <msirenef@lightbird.net> - 2012-12-12 12:18 -0500
    Re: Hollow square program siimnurges@gmail.com - 2012-12-12 09:25 -0800
    Re: Hollow square program siimnurges@gmail.com - 2012-12-12 09:25 -0800

csiph-web