Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #96986

Re: A little test for you Guys😜

Path csiph.com!goblin1!goblin.stu.neva.ru!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.022
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'subject:test': 0.07; '22,': 0.09; 'answering': 0.09; 'output': 0.13; 'def': 0.13; 'value.': 0.15; "'s')": 0.16; 'dictionaries': 0.16; 'evaluates': 0.16; 'input:': 0.16; 'wrote:': 0.16; 'input': 0.18; '2015': 0.20; 'function,': 0.22; 'sep': 0.22; 'sorry,': 0.22; 'header:In-Reply- To:1': 0.24; "doesn't": 0.26; 'define': 0.27; 'question': 0.27; 'message-id:@mail.gmail.com': 0.27; 'function': 0.28; 'way?': 0.29; "i'm": 0.30; 'print': 0.30; 'code': 0.30; 'tue,': 0.34; 'received:google.com': 0.35; 'could': 0.35; 'propose': 0.35; 'asking': 0.35; "isn't": 0.35; 'skip:p 30': 0.35; 'to:addr:python- list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'two': 0.37; 'mean': 0.38; 'to:addr:python.org': 0.40; 'questions': 0.40; 'provide': 0.61; 'here.': 0.62; 'more': 0.63; 'python-list': 0.66; 'here': 0.66; 'subjectcharset:utf-8': 0.71; 'to:name:python': 0.84; 'subject:you': 0.85
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=ecQyetOYcXQeKmk42QTB5S7XQ4x+K3aBOqY6gXhvEO8=; b=Q/Jc45ihpUs8OTBI9xK9Odyu+WjrAp2FIbBCA1tMqjBqzDe7dNnGtpekI1dYNadrJE 91ohZzKyXyLmIHRNlnS+LHHIWzlIQW9/f/mTUz/X1vwNVUmifjT3l+N2+AcbIoyPW0DR 7DZnOBDLL5OnGXTauKBaOODj8YWN0dgg93FjRL+yUfQMlaL30y8eFNWIM0NBLTl+bt0y N6EPGYlqNYddAZY47zgZu3PqwnwKnno+4ZHsdGfPAGU0S5Jw5dAwQpvLjW41E+TLRbhs WjT8MDkTcH9aaBqGsuJL48EefWX3OyQxB84KxQCWTlgChKfGm68lE0IDaTqXJ4W+yBwo 75cQ==
X-Received by 10.129.103.67 with SMTP id b64mr22694686ywc.55.1442949290111; Tue, 22 Sep 2015 12:14:50 -0700 (PDT)
MIME-Version 1.0
In-Reply-To <78fc66f6-04f9-4b84-8410-2e74fb75fbb4@googlegroups.com>
References <78fc66f6-04f9-4b84-8410-2e74fb75fbb4@googlegroups.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Tue, 22 Sep 2015 13:14:10 -0600
Subject Re: A little test for you Guys😜
To Python <python-list@python.org>
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
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 <http://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>
Newsgroups comp.lang.python
Message-ID <mailman.67.1442949299.28679.python-list@python.org> (permalink)
Lines 49
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1442949299 news.xs4all.nl 23849 [2001:888:2000:d::a6]:54835
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:96986

Show key headers only | View raw


On Tue, Sep 22, 2015 at 12:43 PM, Python_Teacher via Python-list
<python-list@python.org> wrote:
> you have 10 minutes😂 Good luck!!

Sorry, I'm more interested in critiquing the questions than answering them.

> Let's define the function plural :
>
> def plural(words):
>     plurals = []
>     for word in words:
>        plurals.append(word + 's')
>     return plurals
>
> for word in plural(['cabagge','owl','toy']):
>     print word
>
> Question : How could the code of the function plural be optimised?

Optimized in what way? To be faster? Use less memory? Be more readable?

> 3 Dictionaries
>
> Here are two dictionnaries :
>
> input = {
>     'foo1': 'bar1',
>     'chose': 'truc',
>     'foo2': 'bar2',
> }
> output = {
>     'bar1': 'foo1',
>     'truc': 'chose',
>     'bar2': 'foo2'
> }
>
> Question : Propose a function that returns output when you provide input ?

def f(maybe_input):
    if maybe_input == input:
        return output

I don't think I really understand what it is that you're asking for here.

> 3. What is the return value of hello.__doc__

hello.__doc__ isn't a function, so it doesn't have a return value. I
think you mean to ask what the expression evaluates to.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

A little test for you Guys😜 Python_Teacher <ljfc2000@yahoo.com> - 2015-09-22 11:43 -0700
  Re: A little test for you Guys😜 Ian Kelly <ian.g.kelly@gmail.com> - 2015-09-22 13:14 -0600
  Re: A little test for you Guys😜 "Sven R. Kunze" <srkunze@mail.de> - 2015-09-22 21:42 +0200
  Re: A little test for you Guys😜 Akira Li <4kir4.1i@gmail.com> - 2015-09-22 22:48 +0300
  Re: A little test for you Guys😜 James Harris <james.harris.1@gmail.com> - 2015-09-22 13:28 -0700
  Re: A little test for you Guys😜 sohcahtoa82@gmail.com - 2015-09-22 14:18 -0700
    Re: A little test for you Guys😜 "James Harris" <james.harris.1@gmail.com> - 2015-09-22 22:31 +0100
    Re: A little test for you Guys😜 Ian Kelly <ian.g.kelly@gmail.com> - 2015-09-22 15:33 -0600
    Re: A little test for you Guys😜 Lj Fc <ljfc2000@yahoo.com> - 2015-09-22 15:21 -0700
  Re: A little test for you Guys😜 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-09-23 00:32 +0100
  Re: A little test for you Guys😜 Chris Angelico <rosuav@gmail.com> - 2015-09-23 09:45 +1000
  Re: A little test for you Guys😜 MRAB <python@mrabarnett.plus.com> - 2015-09-23 00:56 +0100
    Re: A little test for you Guys😜 alister <alister.nospam.ware@ntlworld.com> - 2015-09-23 18:06 +0000
  Re: A little test for you Guys😜 Christian Gollwitzer <auriocus@gmx.de> - 2015-09-23 08:26 +0200

csiph-web