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


Groups > comp.lang.python > #39125

Re: request for help

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <gary.herron@islandtraining.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'subject:help': 0.07; 'python': 0.09; 'received:67.192': 0.09; 'received:67.192.241': 0.09; 'received:dfw.emailsrvr.com': 0.09; 'def': 0.10; '"import': 0.16; '11:42': 0.16; 'failed.': 0.16; 'wrote:': 0.17; 'fix': 0.17; 'copied': 0.17; "shouldn't": 0.17; 'subject:request': 0.17; 'shell': 0.18; 'code,': 0.18; 'math': 0.20; 'import': 0.21; 'received:emailsrvr.com': 0.22; 'tried': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'first,': 0.27; 'spaces': 0.29; 'received:(smtp server)': 0.30; 'function': 0.30; 'error': 0.30; 'file': 0.32; 'to:addr:python-list': 0.33; 'version': 0.34; 'saved': 0.35; 'really': 0.36; 'anything': 0.36; 'should': 0.36; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'help': 0.40; 'your': 0.60; 'lost': 0.60; 'telling': 0.61; 'kind': 0.61; 'more': 0.63; 'is!': 0.84; 'pasting': 0.84; 'cutting': 0.93
X-Virus-Scanned OK
Date Mon, 18 Feb 2013 11:54:51 -0800
From Gary Herron <gary.herron@islandtraining.com>
User-Agent Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130106 Thunderbird/17.0.2
MIME-Version 1.0
To python-list@python.org
Subject Re: request for help
References <B7C01624-32AB-49CE-AAB4-064A5B8E54CB@icloud.com>
In-Reply-To <B7C01624-32AB-49CE-AAB4-064A5B8E54CB@icloud.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
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 <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1968.1361217702.2939.python-list@python.org> (permalink)
Lines 36
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1361217702 news.xs4all.nl 6856 [2001:888:2000:d::a6]:47418
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:39125

Show key headers only | View raw


On 02/18/2013 11:42 AM, leonardo selmi wrote:
> pls i need help:
>
> i have copied the following from a book and tried to make it work:
>
> import math
>
> def area(radius):
> return math.pi * radius**2
>
> def circumference(radius):
> return 2 * math.pi * radius
>
> i saved the above program from python shell into a file as "circle.py" . when i type "import circle" i get  error..
>
>
> kind regards

First, you shouldn't ask us to help you fix an error without telling us 
what the error is!   You should also tell us what version of Python and 
what system (Windows? Linux? ...) , and anything more that can help us 
understand what you did and what failed.


So this is just guesswork:
Spaces are important in Python.  The body of a function **must** be 
indented.  If you do have the indents in your code, and they were just 
lost in the process of cutting and pasting and emailing, the we really 
do need more information.

def area(radius):
     return math.pi * radius**2

def circumference(radius):
     return 2 * math.pi * radius

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


Thread

Re: request for help Gary Herron <gary.herron@islandtraining.com> - 2013-02-18 11:54 -0800

csiph-web