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


Groups > comp.lang.python > #67406

Re: Boxes of O's

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'permitted': 0.07; "'')": 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'wrote': 0.14; '2):': 0.16; 'loops': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'tool.': 0.16; 'pieces': 0.19; 'print': 0.22; 'first,': 0.26; 'second': 0.26; 'header:X -Complaints-To:1': 0.27; 'function': 0.29; 'could': 0.34; 'case,': 0.35; 'so,': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'called': 0.40; 'solve': 0.60; 'length': 0.61; 'first': 0.61; 'email addr:gmail.com': 0.63
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Dave Angel <davea@davea.name>
Subject Re: Boxes of O's
Date Sat, 1 Mar 2014 22:04:13 -0500 (EST)
Organization news.gmane.org
References <c753ba44-379b-4322-96c0-4ba5cb8fa7c1@googlegroups.com> <mailman.7529.1393701408.18130.python-list@python.org> <31bde8f6-25a6-484f-af6b-bbef7f7a0fdf@googlegroups.com>
X-Gmane-NNTP-Posting-Host dpc6744192186.direcpc.com
X-Newsreader PiaoHong Usenet NewsReaders 1.36
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.7559.1393729214.18130.python-list@python.org> (permalink)
Lines 26
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1393729214 news.xs4all.nl 2887 [2001:888:2000:d::a6]:40874
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:67406

Show key headers only | View raw


 geniusrko@gmail.com Wrote in message:
> Well, This is what i got 
> 
> n = int(input("enter number of o: "))
> 
> for i in range(n):
>     print("O", end = '')
>     for j in range(n* 2):
>         print("O", end = '')
>     
>     print()
> 

Are you permitted to write and call functions? If so, then write
 functions to solve pieces of the problem, and call those
 functions from your main one.  That's called factoring,  and is
 an important tool.

In this case,  one function could print a row of 'o' of length
 siz, while the second one print a 'hollow' row. Then your main
 calls first, then loops calling hollow, then calls first
 again.

-- 
DaveA

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


Thread

Boxes of O's geniusrko@gmail.com - 2014-03-01 11:12 -0800
  Re: Boxes of O's Chris Angelico <rosuav@gmail.com> - 2014-03-02 06:16 +1100
    Re: Boxes of O's geniusrko@gmail.com - 2014-03-01 11:28 -0800
      Re: Boxes of O's MRAB <python@mrabarnett.plus.com> - 2014-03-01 19:41 +0000
      Re: Boxes of O's Chris Angelico <rosuav@gmail.com> - 2014-03-02 06:54 +1100
        Re: Boxes of O's geniusrko@gmail.com - 2014-03-02 06:43 -0800
          Re: Boxes of O's Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-02 14:56 +0000
          Re: Boxes of O's Glazner <yoavglazner@gmail.com> - 2014-03-02 13:30 -0800
          Re: Boxes of O's Michael Torrie <torriem@gmail.com> - 2014-03-02 14:48 -0700
      Re: Boxes of O's Dave Angel <davea@davea.name> - 2014-03-01 22:04 -0500

csiph-web