Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.029 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'bits': 0.07; 'strings.': 0.07; 'slices': 0.09; 'cc:addr:python-list': 0.10; 'subject:python': 0.11; 'language': 0.14; 'assignment.': 0.16; 'bits,': 0.16; 'looping': 0.16; 'wrote:': 0.17; 'mechanism': 0.17; 'specify': 0.17; 'code,': 0.18; 'cc:2**0': 0.23; 'seems': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header :In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'implemented': 0.27; 'in.': 0.27; 'rest': 0.28; 'probably': 0.29; 'shift': 0.33; 'version': 0.34; 'subject:?': 0.35; 'subject:with': 0.36; 'subject:: ': 0.38; 'received:192': 0.39; 'received:192.168': 0.40; 'help': 0.40; 'your': 0.60; 'most': 0.61; 'email addr:gmail.com': 0.63; 'show': 0.63; 'header:Reply- To:1': 0.68; 'obvious': 0.71; 'received:74.208': 0.71; 'reply- to:no real name:2**0': 0.72; 'etc..': 0.84; "it'd": 0.84; 'working,': 0.84 Date: Fri, 21 Sep 2012 10:00:33 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: echo.hping@gmail.com Subject: Re: how to do draw pattern with python? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:5IwL8ewx+313RD3GVV04bYAy5In0pjB6enhq8s50RtB Ur/AEOG5wkoOCxLHimkYIR7lTZAXKfPAZ83MLu6LDvoojYlDj2 Oc1LYiZw8urpcaBCpHdZ7/aXDhzPYqK5ALlEiOTnHZkQRUoKJu gTKYuGiHn7oWL3n+hq5uAFq0QzA/sz8OfmDDZFtJ8uZp+Hr6Mr bp0afxy0m4yj9Tg3L/cpwPVXG22p5l+Gu/xLWslQCgz2lpVV5F Mk0xOb1lqVM29V1dMpmPFD/lf/zfoDOsuizD+IQHbcK83rIGR2 okBT2+Zz+2YUSEToTL+AvQ8SilTtU34z1htTeVX8beLLLOnXw= = Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: d@davea.name List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 40 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1348236061 news.xs4all.nl 6950 [2001:888:2000:d::a6]:54017 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:29637 On 09/21/2012 09:36 AM, echo.hping@gmail.com wrote: > may i know how to shift the bits using only looping and branching?? Yes, show us your code, and what isn't working, and we'll try to help you complete the assignment. It'd probably also be good to specify the rest of the homework, like what version of what language it has to be implemented in. I don't see any bits, only strings of characters. And it seems to me that using slices is the most obvious mechanism for rotating fixed-length strings. > x....x > .x..x. > ..xx.. > ..xx.. > .x..x. > x....x > > xx.... > ..x..x > ...xx. > ...xx. > ..x..x > xx.... > > .xx... > x..x.. > ....xx > ....xx > x..x.. > .xx... > > etc.. -- DaveA