Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Real Programmers think better when playing Adventure or Rogue.


devel / comp.lang.python / Re: Return

SubjectAuthor
o Re: Returndn

1
Re: Return

<mailman.38.1638914590.15287.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=20748&group=comp.lang.python#20748

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: PythonList@DancesWithMice.info (dn)
Newsgroups: comp.lang.python
Subject: Re: Return
Date: Wed, 8 Dec 2021 11:02:57 +1300
Organization: DWM
Lines: 67
Message-ID: <mailman.38.1638914590.15287.python-list@python.org>
References: <CAHVaEHhKkpB49o5fUzwXH3s0r_zsTwDUsFy1jLk8b+NWGpXAGA@mail.gmail.com>
<CALk2KRXdXypvMTJrAkPR0xL6BheLaS1u+Ot3KWWQ8feMqVh_jQ@mail.gmail.com>
<43f4d05e-e994-f90a-b397-d8af2a6f2817@DancesWithMice.info>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de NE6vR5eT6JQbqccfBwRH0gdjvf1+iP4X04nTJN9wYaIg==
Return-Path: <PythonList@DancesWithMice.info>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=danceswithmice.info header.i=@danceswithmice.info
header.b=Qo4jy0w8; dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.017
X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'def': 0.04; '=dn': 0.09;
'code?': 0.09; 'from:addr:danceswithmice.info': 0.09;
'from:addr:pythonlist': 0.09; 'implicit': 0.09; 'question:': 0.09;
'unlike': 0.09; 'explicit': 0.16; 'message-
id:@DancesWithMice.info': 0.16; 'received:51.254': 0.16;
'received:51.254.211': 0.16; 'received:51.254.211.219': 0.16;
'received:cloud': 0.16; 'received:rangi.cloud': 0.16; 'values,':
0.16; 'wrote:': 0.16; 'python': 0.16; 'to:addr:python-list': 0.20;
'python,': 0.25; 'hey': 0.27; 'function': 0.27; 'header:User-
Agent:1': 0.30; 'header:Organization:1': 0.31; 'python-list':
0.32; 'someone': 0.34; 'header:In-Reply-To:1': 0.34; 'understood':
0.35; 'using': 0.37; 'received:192.168': 0.37; 'thanks': 0.38;
'something': 0.40; 'pass': 0.64; 'received:51': 0.64; 'your':
0.64; 'tool': 0.65; 'received:userid': 0.66; 'skip:# 10': 0.68;
'2021': 0.71; 'article': 0.73; 'plus': 0.73; 'skip:f 20': 0.75;
'languages,': 0.76; 'roland': 0.84; 'thus:': 0.84; 'return.': 0.91
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on vps517507.ovh.net
X-Spam-Level:
X-Spam-Status: No, score=-5.4 required=5.0 tests=ALL_TRUSTED,BAYES_00,
DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,NICE_REPLY_A autolearn=ham
autolearn_force=no version=3.4.0
DKIM-Filter: OpenDKIM Filter v2.11.0 mail.rangi.cloud 7066F5C77
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=danceswithmice.info;
s=staff; t=1638914588;
bh=jMSyXDgmlQgjE1ES/M9p37ohS8y/QpMH2XqjPxzpn7g=;
h=Date:Subject:To:References:From:In-Reply-To:From;
b=Qo4jy0w8oGm9dJ4V66zsAL8kF8EcXzJlV5yTQF/YzYthobmiwREkv+oiiTTQ/+YYs
FPB1/VOAc37HumjBzldxUvNWXZFLBKsBjgA93MhFehHN794j1UwiSRb6U8PxyEK7dW
N9wLElSZqOeYVKTTZQF1iqUK46tWix7BJbcQYReKsStV+vBEjs3HcFozb3Vy3KVXyf
rJ/+mGSX3qMcOP9ZT1HjaRel5ZlRW4bWWYf+fjTLJeXOcJmgK93Po/9SOhxEpP9QgF
EvTIihdVvf5r1iWrVKNccbWInJkxZmlSCurFORIjElgjvmd/RTcWynzToFFCK0kE6M
8H9Y6pu2LJHeg==
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.3.2
Content-Language: en-GB
In-Reply-To: <CALk2KRXdXypvMTJrAkPR0xL6BheLaS1u+Ot3KWWQ8feMqVh_jQ@mail.gmail.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.38
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://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: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <43f4d05e-e994-f90a-b397-d8af2a6f2817@DancesWithMice.info>
X-Mailman-Original-References: <CAHVaEHhKkpB49o5fUzwXH3s0r_zsTwDUsFy1jLk8b+NWGpXAGA@mail.gmail.com>
<CALk2KRXdXypvMTJrAkPR0xL6BheLaS1u+Ot3KWWQ8feMqVh_jQ@mail.gmail.com>
 by: dn - Tue, 7 Dec 2021 22:02 UTC

On 08/12/2021 09.45, Roland Mueller via Python-list wrote:
> Hello
>
> ti 7. jouluk. 2021 klo 19.47 vani arul (arulvani66@gmail.com) kirjoitti:
>
>> Hey There,
>> Can someone help to understand how a python function can return value with
>> using return in the code?
>> It is not not about explicit or implicit function call.
>>
>>
> Not sure whether I understood your question: I have a simple example about
> return.
> * f() and h() explicitely return something
> * g() and h() return None
>
> BTW, also Python documentation tool pydoc has an article about return.
>
> #!/usr/bin/python
>
> def f():
> return 42
> def g():
> pass
> def h():
> return
>
> if __name__ == "__main__":
> print(f"f(): {f()}")
> print(f"g(): {g()}")
> print(f"h(): {h()}")
>
> Result:
> f(): 42
> g(): None
> h(): None
>
> Pydoc:
> $ pydoc return
>
> BR,
> Roland
>
>
>> Thanks
>> Vani

plus Python, unlike some other languages, allows us to return multiple
values, either as a collection or as an implied-tuple:

def function_list():
a_list = [ i for i in range( 9 ) ]
return a_list

def function_multiples():
a = 1
b = 2
c = 3
return a, b, c

thus:

x, y, z = function_multiples()
--
Regards,
=dn


devel / comp.lang.python / Re: Return

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor