Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #75192
| 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 | <ian.g.kelly@gmail.com> |
| 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 | <ffce5f1b-91b6-4ac1-99dc-e3eef51694d3@googlegroups.com> |
| References | <95524a09-7792-4cec-8c7e-7525a358ee8c@googlegroups.com> <8761imu93j.fsf@elektro.pacujo.net> <ffce5f1b-91b6-4ac1-99dc-e3eef51694d3@googlegroups.com> |
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Date | Thu, 24 Jul 2014 19:50:34 -0600 |
| Subject | Re: What is the simplest method to get a vector result? |
| To | Python <python-list@python.org> |
| 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 <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.12307.1406253077.18130.python-list@python.org> (permalink) |
| 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 |
Show key headers only | View raw
On Thu, Jul 24, 2014 at 7:29 PM, fl <rxjwg98@gmail.com> 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.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
What is the simplest method to get a vector result? fl <rxjwg98@gmail.com> - 2014-07-24 05:53 -0700
Re: What is the simplest method to get a vector result? Alan <alan.isaac@gmail.com> - 2014-07-24 06:10 -0700
Re: What is the simplest method to get a vector result? Vlastimil Brom <vlastimil.brom@gmail.com> - 2014-07-24 15:49 +0200
Re: What is the simplest method to get a vector result? fl <rxjwg98@gmail.com> - 2014-07-25 16:08 -0700
Re: What is the simplest method to get a vector result? Ian Kelly <ian.g.kelly@gmail.com> - 2014-07-25 18:37 -0600
Re: What is the simplest method to get a vector result? fl <rxjwg98@gmail.com> - 2014-07-25 19:17 -0700
Re: What is the simplest method to get a vector result? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-24 14:06 +0000
Re: What is the simplest method to get a vector result? Marko Rauhamaa <marko@pacujo.net> - 2014-07-24 17:25 +0300
Re: What is the simplest method to get a vector result? fl <rxjwg98@gmail.com> - 2014-07-24 18:29 -0700
Re: What is the simplest method to get a vector result? Ian Kelly <ian.g.kelly@gmail.com> - 2014-07-24 19:50 -0600
Re: What is the simplest method to get a vector result? Dave Angel <davea@davea.name> - 2014-07-24 22:44 -0400
Re: What is the simplest method to get a vector result? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-25 03:23 +0000
csiph-web