Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'column': 0.07; 'python3': 0.07; 'method,': 0.09; 'subject:method': 0.09; 'python': 0.11; 'skip:= 70': 0.12; '"*"': 0.16; '"from': 0.16; '24,': 0.16; '__future__': 0.16; 'range(0,': 0.16; 'thursday,': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'code.': 0.18; 'thu,': 0.19; 'written': 0.21; 'import': 0.22; 'math': 0.24; 'file.': 0.24; 'header:In- Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'assumes': 0.31; 'division': 0.31; 'probably': 0.32; 'skip:# 10': 0.33; 'maybe': 0.34; 'subject:the': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'two': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'july': 0.63; 'jul': 0.74; 'subject:get': 0.81; '180': 0.84; 'intentions': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=wl/J/IvTwbl/zhBtY1oyyiZgIq1gcm84MoQiagGepu0=; b=xbP2vn71kYXQY8qCRkljtCmdzkVdTOgc2Zb/bO+y6kDdsAtmsWAzQteLFid0fHvuJ7 J3PE7HbEXZc4WrLpNWSfQXXWZOhJhvFiOMl0U8nSUk5+ZX/LttDq8wVS4dg3QzTZOg4B AvQmF5xsDoal1YWFFXRI5Ke4scgo73HooC+uNW+l+5y2qerJIf9S7yvUn0bO2T/xdVnJ N8LqfZhRWGgWRF6MQmlORZXFYzeFGzjnMuZMXVzhxSsa/hmRmI4YKx/bseY6Btl9FUg1 9QSzocxRR701/doyJ6vcCiez+2U/BdnII+gwAsVk3KAE1WSsFZVFefEOiRfqR9pemr8m UyMw== X-Received: by 10.68.242.103 with SMTP id wp7mr15019790pbc.131.1406253074492; Thu, 24 Jul 2014 18:51:14 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <95524a09-7792-4cec-8c7e-7525a358ee8c@googlegroups.com> <8761imu93j.fsf@elektro.pacujo.net> From: Ian Kelly Date: Thu, 24 Jul 2014 19:50:34 -0600 Subject: Re: What is the simplest method to get a vector result? To: Python Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1406253077 news.xs4all.nl 2829 [2001:888:2000:d::a6]:47309 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:75192 On Thu, Jul 24, 2014 at 7:29 PM, fl wrote: > On Thursday, July 24, 2014 10:25:52 AM UTC-4, Marko Rauhamaa wrote: >> #!/usr/bin/env python3 >> >> import math >> >> for x in range(0, 361, 15): >> >> print(int((math.sin(x / 180 * math.pi) + 1) * 30 + 0.5) * " " + "*") >> >> ======================================================================== >> >> >> Marko > > I like your method, but I get a column of '*'. Maybe you have other intentions > of your code. I am puzzled about the last part of your code and want to learn > from it (" * " " + "*" "). You probably ran it with Python 2. That code was written for Python 3 and assumes that division of two ints will return a float. You can also fix it by adding the line "from __future__ import division" at the top of the file.