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


Groups > comp.lang.python > #36498

Re: new to python and programming at large

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'argument': 0.04; 'root': 0.04; 'context': 0.05; 'classes.': 0.07; 'compute': 0.09; 'def': 0.10; 'subject:python': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'needed?': 0.16; 'subject:programming': 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'jan': 0.18; '>>>': 0.18; 'math': 0.20; 'question.': 0.20; 'import': 0.21; 'help.': 0.22; 'pass': 0.25; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'convention': 0.27; 'message-id:@mail.gmail.com': 0.27; 'received:209.85.212': 0.28; 'chris': 0.28; 'probably': 0.29; 'function': 0.30; 'print': 0.32; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'received:209.85': 0.35; 'really': 0.36; 'but': 0.36; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'your': 0.60; 'more': 0.63; '2013': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=D1u/IQC6r4bDLiECwKAV6WLCA616DWksRLdFmfoB4OM=; b=JMzdcGZiDGCoYUtQkCNhr7QQvRJ+XDFVIDNvR+O/TxgPChmenAPfYnAhJQdVX1lSKq Cn1RNjUmmPujjTdhRvmSdR56kD6FkgdFpRu9W3lW7vm0xBnu1qCWQZMZkfO0BFrO+PJB xq7s01pJ3ux3Z+0csKPGUoxwbB3n3hWihJ/r627VbBeewdAZift8wA61ZyMUr1ySHFAj 53baNShm9V8u+wZoeDLnfn5ZoZHY+dCFmJAfJlTU0OyYKPXhppJjPn7hyOqey9z1A4u/ kyz1BIz1khSnfNCLqILGjIbM65CnxSpQv9vyy6A24A5NsjILLAC4JyXaZ76wLlm63v7v zcjQ==
MIME-Version 1.0
In-Reply-To <M9gHs.6$6N2.4@fx17.fr7>
References <0CF6C67958A245C883EB705CEF9F968F@favour> <mailman.319.1357744700.2939.python-list@python.org> <M9gHs.6$6N2.4@fx17.fr7>
Date Thu, 10 Jan 2013 02:43:23 +1100
Subject Re: new to python and programming at large
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
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.320.1357746205.2939.python-list@python.org> (permalink)
Lines 25
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1357746205 news.xs4all.nl 6857 [2001:888:2000:d::a6]:35241
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:36498

Show key headers only | View raw


On Thu, Jan 10, 2013 at 2:38 AM, Alister <alister.ware@ntlworld.com> wrote:
> On Thu, 10 Jan 2013 02:18:11 +1100, Chris Angelico wrote:
>
>> On Thu, Jan 10, 2013 at 8:03 AM,  <kwakukwatiah@gmail.com> wrote:
>>> pls  I want to write a function that can compute for the sqrt root of
>>> any number.bt it not working pls help.
>>> from math import sqrt def squareroot(self):
>>>     x = sqrt(y)
>>>     print x
>>
>> The 'self' argument is a convention used in classes. You probably want
>> to call your argument y:
>>
>> def squareroot(y):
>>
>> since that's what you then pass to math.sqrt.
>>
>> Chris Angelico
>
> why even do this when simply calling sqrt is all that is needed?

Good question. But without a lot more context from the OP, none of
this is really ponderable...

ChrisA

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


Thread

Re: new to python and programming at large Chris Angelico <rosuav@gmail.com> - 2013-01-10 02:18 +1100
  Re: new to python and programming at large Alister <alister.ware@ntlworld.com> - 2013-01-09 15:38 +0000
    Re: new to python and programming at large Chris Angelico <rosuav@gmail.com> - 2013-01-10 02:43 +1100

csiph-web