Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #97012
| Path | csiph.com!news.mixmin.net!newsreader4.netcologne.de!news.netcologne.de!feeder1.cambriumusenet.nl!feed.tweak.nl!194.109.133.81.MISMATCH!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!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 | <python@mrabarnett.plus.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.013 |
| X-Spam-Evidence | '*H*': 0.97; '*S*': 0.00; 'subject:test': 0.07; 'throw': 0.09; 'python': 0.10; 'output': 0.13; 'def': 0.13; 'instead.': 0.15; "'input'": 0.16; "'s')": 0.16; 'bugs.': 0.16; 'dictionaries': 0.16; 'fold': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'optimised': 0.16; 'pep8': 0.16; 'received:192.168.1.4': 0.16; 'wrote:': 0.16; 'programmer': 0.18; 'input': 0.18; 'lawrence': 0.22; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'distribute': 0.27; 'define': 0.27; 'used,': 0.27; 'question': 0.27; 'function': 0.28; 'print': 0.30; 'code': 0.30; 'source': 0.33; 'lists': 0.34; 'could': 0.35; 'clear': 0.35; 'propose': 0.35; 'skip:p 30': 0.35; 'should': 0.36; 'there': 0.36; 'to:addr :python-list': 0.36; 'subject:: ': 0.37; 'two': 0.37; 'being': 0.37; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'mark': 0.40; 'some': 0.40; 'provide': 0.61; 'different': 0.63; 'between': 0.65; 'python-list': 0.66; 'here': 0.66; 'subjectcharset:utf-8': 0.71; 'paper': 0.73; 'dict.': 0.84; 'function():': 0.84; 'subject:you': 0.85; 'sheet': 0.93 |
| X-CM-Score | 0.00 |
| X-CNFS-Analysis | v=2.1 cv=CvRCCSMD c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=EBOSESyhAAAA:8 a=IkcTkHD0fZMA:10 a=4zmYDub8Jl8iebof9xQA:9 a=QEXdDO2ut3YA:10 |
| X-AUTH | mrabarnett@:2500 |
| Subject | Re: A little test for you Guys😜 |
| To | python-list@python.org |
| References | <78fc66f6-04f9-4b84-8410-2e74fb75fbb4@googlegroups.com> <mtsoeh$cut$1@ger.gmane.org> |
| From | MRAB <python@mrabarnett.plus.com> |
| Date | Wed, 23 Sep 2015 00:56:19 +0100 |
| User-Agent | Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 |
| MIME-Version | 1.0 |
| In-Reply-To | <mtsoeh$cut$1@ger.gmane.org> |
| Content-Type | text/plain; charset=utf-8; format=flowed |
| Content-Transfer-Encoding | 8bit |
| 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.85.1442966183.28679.python-list@python.org> (permalink) |
| Lines | 66 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1442966183 news.xs4all.nl 23809 [2001:888:2000:d::a6]:45659 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:97012 |
Show key headers only | View raw
On 2015-09-23 00:32, Mark Lawrence wrote:
> On 22/09/2015 19:43, Python_Teacher via Python-list wrote:
>> you have 10 minutes😂 Good luck!!
>>
>>
>> 1. What is PEP8 ?
>
> It's the one between PEP7 and PEP9.
>
>>
>> 2. What are the different ways to distribute some python source code ?
>
> Write on sheet of paper, fold into paper dart, throw from window.
>
>>
>> 2 Lists
>
> Tut, tut, tut.
>
>>
>> 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?
>
> It is all ready optimised for programmer time so don't bother with it
> unless there are unforeseen bugs.
>
>>
>> 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 function():
> return input("Who cares?")
>
You have a couple of problems:
1. 'input' is already bound to a dict.
2. From question 2, it's clear that Python 2 is being used, so you
should be using 'raw_input' instead.
[snip]
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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