Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'argument': 0.04; 'root': 0.04; 'classes.': 0.07; 'compute': 0.09; 'def': 0.10; 'subject:python': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:programming': 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'jan': 0.18; 'math': 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; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'your': 0.60; '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=cI70k39nD8dwlh8P0+vqvsmxTnU7kmCnkjeKX+piV0o=; b=oQHe7lC/fnl8nIALcCegh8d+w3yuEve2K4rGYYGMVSXsOZjQSRS+wrXF+bZoHaL9YV bD8X39HPKwPaYwjnGeJJit0ZeVJqQ+AvlCd9jMalC+AOqG4ohvn+hxfwxOVFeoCH9f/L uQ6DReBXjXk6DeKjaPGeHRqKzHksFbnDEKZJfdJ4bVti3uZgARyTfHLVBIXwnWWyxDWn unXoi16j7YbPHcnKsvAoVa/76yKG/XOKUI7LHZ+7ukTkWOesCZPPqVrT4MlmHvu2G2zW 3NsUGMCbAnLr8GWEUx7P7SpjhNiG/rEwdyYrh24fa0tKegEXMb58mWNlKayWGp7dmQzx 3Azg== MIME-Version: 1.0 In-Reply-To: <0CF6C67958A245C883EB705CEF9F968F@favour> References: <0CF6C67958A245C883EB705CEF9F968F@favour> Date: Thu, 10 Jan 2013 02:18:11 +1100 Subject: Re: new to python and programming at large From: Chris Angelico 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1357744700 news.xs4all.nl 6852 [2001:888:2000:d::a6]:55986 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:36496 On Thu, Jan 10, 2013 at 8:03 AM, 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