Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.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.038 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'subject:Python': 0.05; 'situation.': 0.09; 'cc:addr:python-list': 0.10; 'python': 0.11; 'def': 0.14; 'wrote:': 0.16; 'thanks,': 0.19; 'cc:2**0': 0.21; 'cc:addr:python.org': 0.21; 'function,': 0.22; '2015': 0.23; 'header:In-Reply-To:1': 0.24; 'message-id:@mail.gmail.com': 0.28; 'tutorial': 0.29; 'url:mailman': 0.31; 'says': 0.32; 'url:python': 0.33; 'subject:?': 0.34; 'received:google.com': 0.34; 'url:listinfo': 0.35; 'url:org': 0.36; 'possible.': 0.36; 'hi,': 0.37; 'subject:: ': 0.37; 'tue,': 0.38; 'say': 0.38; 'pm,': 0.39; 'does': 0.39; 'data': 0.40; 'results': 0.66; 'to:none': 0.90; 'joel': 0.91; 'yes!': 0.91 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:cc :content-type; bh=S03BUYTT/CAiLQSAyjZiB4blXOJ/iJmLceZfPLdMYGw=; b=IeWLSiLdbsGI47xROL4Z9exhq3wu1FIxW+KsxCrFWiOUeVZbp9mnsQdXXNwBEFThy3 2rlJlZ8kZXV11tTYgLIJQ5bfqXTwFHzeT9c9Sqht9cURDlevC/N6d3U5LINu4kAS2cGA qPIN7YMZDLG7nnhR7w/TWQEU2U8EdkuKRNNpB0ysakPmfafw+3rEoEyC9I3MnTDlk0cu JXA8ppWSnc/usFQjerqzEeJnha+qgWdTH7f2tPlI0pbqfMr9FQWFjM/9VE8CPJeIn2dF ejKLhBJ+LX0S4u38ULClDmubTKbtbJQN0oRsNMV1uYgWMGnDGgXj6UksdEldGwcNSIul aPrw== MIME-Version: 1.0 X-Received: by 10.50.138.232 with SMTP id qt8mr22925681igb.28.1433280951349; Tue, 02 Jun 2015 14:35:51 -0700 (PDT) In-Reply-To: <3bbe49da-e989-4a8c-a8a9-75d3a786f508@googlegroups.com> References: <3bbe49da-e989-4a8c-a8a9-75d3a786f508@googlegroups.com> Date: Tue, 2 Jun 2015 17:35:51 -0400 Subject: Re: Can Python function return multiple data? From: Joel Goldstick Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1433280959 news.xs4all.nl 2825 [2001:888:2000:d::a6]:47180 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:91900 On Tue, Jun 2, 2015 at 5:27 PM, fl wrote: > Hi, > > I just see the tutorial says Python can return value in function, it does > not say multiple data results return situation. In C, it is possible. > How about Python on a multiple data return requirement? > > > Thanks, > -- > https://mail.python.org/mailman/listinfo/python-list Yes! def my_function(n): return n, n*2 a_number, its_double = my_function(3) a_number will be 3, its_double will be 6 -- Joel Goldstick http://joelgoldstick.com