Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!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.068 X-Spam-Evidence: '*H*': 0.87; '*S*': 0.01; 'cc:addr:python-list': 0.11; "','": 0.16; 'comma': 0.16; 'separator,': 0.16; 'subject:howto': 0.16; 'subject:remove': 0.16; 'wrote:': 0.18; 'pfxlen:0': 0.19; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; 'subject:the': 0.34; 'problem': 0.35; 'received:google.com': 0.35; '14,': 0.36; 'how': 0.40; 'remove': 0.60; 'such': 0.63; 'to:addr:gmail.com': 0.65; 'reply': 0.66; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=AFQwRxRl0rDKoHNQkuvBiYGopLIBTFaZ4jmMSlsdMw8=; b=SGxPK7GJBtb3yy8Vt4UC8DEjgw9iyDXxEon82oKnLWHKXqPKevNQiNKLspBwk9PmkQ O2cpts1eQntvCaMIsDw6+6MC631riR+E6exUJiKV/OJhWgAVIC/M22dvzX6v5Z1Jxai1 C2PH0/ROsVMt1KuqVSBtreViyyqPsQkOYXRJ3y4i+fX8AvRLI0Bd3eoqNsio19rEKdBY kc1kQKvos1gJ1farXqMlqmHamUL87EHUsMBm0VJR/M2hs6fZNWEKuF3mSBa9CdvUbbr1 /dYEA1kHzjBcJdUq/DD+UkGchtOx05elgsun4Yj0hT4TWRu+sET7pw4XlKJriyQs8xBv H6Sw== MIME-Version: 1.0 X-Received: by 10.180.39.207 with SMTP id r15mr7852909wik.16.1365966372189; Sun, 14 Apr 2013 12:06:12 -0700 (PDT) In-Reply-To: <201304150257331336590@gmail.com> References: <201304150257331336590@gmail.com> Date: Sun, 14 Apr 2013 12:06:12 -0700 Subject: Re: howto remove the thousand separator From: Mark Janssen To: pyth0n3r Content-Type: text/plain; charset=ISO-8859-1 Cc: python-list 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1365966380 news.xs4all.nl 2648 [2001:888:2000:d::a6]:50625 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:43575 On Sun, Apr 14, 2013 at 11:57 AM, pyth0n3r wrote: > I came across a problem that when i deal with int data with ',' as thousand > separator, such as 12,916, i can not change it into int() or float(). > How can i remove the comma in int data? > Any reply will be appreciated!! cleaned='' for c in myStringNumber: if c != ',': cleaned+=c int(cleaned) mark