Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.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.041 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'correct.': 0.07; 'subject:Error': 0.07; 'converted': 0.09; 'negative.': 0.09; 'python': 0.11; "'input'": 0.16; 'evaluates': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'roy': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'value.': 0.19; 'entered': 0.20; 'integer': 0.24; 'string,': 0.24; 'first,': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'evaluation': 0.30; 'statement': 0.30; 'strongly': 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; "i'd": 0.34; 'one,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; "you're": 0.61; 'name': 0.63; 'smith': 0.68; 'stated': 0.69; 'goal': 0.75; 'article': 0.77; 'glad': 0.83; 'batchelder': 0.84; 'subject:Testing': 0.84; 'scott': 0.93; '2013': 0.98 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=Alby7Gi89ZuD5P4pqIqhISa/x9BzWYCGj/u4PGM3MMI=; b=iu8E6+HtxGksXoN5lWg5vOxQP08pIzIJ9nyjsVx821zPULooWDdWJLmZ72lHBIa2QM LE+mYoTuc/nw2KdZWRz+QQuSWvsYSkEHJ/MLgw5xzfbHUxObeLZfdWeYHwnkpw5J+J8q CK9BUgCMCAg0G+dzixdU0+4uD2GelJKpwHsoyMJQM31TkcyUUL71wTay1SuzrhO2LkKd PKQZUZumadiCi0By0BtG8iMTWMaS0NrQQa6cZ+oL71UGlJX59IwUVfq1JNWK53FEGKFj YsdNUG5phCFu+KM5vebjY7KZ9l+yR2omz7+k/GBMxPlbpAjipFvFZ6WJt5WzTKhiRt8j kcXg== MIME-Version: 1.0 X-Received: by 10.68.101.3 with SMTP id fc3mr8050762pbb.107.1382187853997; Sat, 19 Oct 2013 06:04:13 -0700 (PDT) In-Reply-To: References: <33549834-2f27-47f3-abea-eb3486909dec@googlegroups.com> Date: Sun, 20 Oct 2013 00:04:13 +1100 Subject: Re: Error Testing 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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1382187856 news.xs4all.nl 15996 [2001:888:2000:d::a6]:52890 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:57098 On Sat, Oct 19, 2013 at 11:57 PM, Roy Smith wrote: > On 10/19/13 8:23 AM, Scott Novinger wrote: >> > My goal is to make sure that the value entered for the radius is an integer >> > value. > > In article , > Ned Batchelder wrote: > >> First, radius is the result of input(), so it is >> always a string, never an int. > > input() returns ints or floats for values which can be converted to > those. I suspect you're thinking of raw_input()? Negative. The OP stated Python 3.2, in which Ned's statement is correct. :) In Python 2.x, yes, input() will return an int if it evaluates as one, but in 2.x, I would STRONGLY advise against ever using non-raw input(). (To be honest, I'd have to say that the innocuous name 'input' concealing code evaluation is an embarrassment, and one that I'm very much glad is now removed from the language.) ChrisA