Re: How is this evaluated

2013-07-05 Thread Steven D'Aprano
On Fri, 05 Jul 2013 17:05:49 +1000, Chris Angelico wrote: > On Fri, Jul 5, 2013 at 11:41 AM, Steven D'Aprano > wrote: >> If you know C, that's like: >> >> ?(condition-being-tested, value-if-true, value-if-false) > > Or to be precise: > > condition-being-tested ? value-if-true : value-if-fal

Re: How is this evaluated

2013-07-05 Thread Chris Angelico
On Fri, Jul 5, 2013 at 11:41 AM, Steven D'Aprano wrote: > If you know C, that's like: > > ?(condition-being-tested, value-if-true, value-if-false) Or to be precise: condition-being-tested ? value-if-true : value-if-false ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: How is this evaluated

2013-07-04 Thread Steven D'Aprano
On Thu, 04 Jul 2013 10:20:43 -0700, Arturo B wrote: > I'm making this exercise: (Python 3.3) > > Write a function translate() that will translate a text into > "rövarspråket" (Swedish for "robber's language"). That is, double every > consonant and place an occurrence of "o" in between. For exampl

Re: How is this evaluated

2013-07-04 Thread Jussi Piitulainen
Arturo B writes: > I'm making this exercise: (Python 3.3) > > Write a function translate() that will translate a text into > "rövarspråket" (Swedish for "robber's language"). That is, double > every consonant and place an occurrence of "o" in between. For > example, translate("this is fun") shoul

Re: How is this evaluated

2013-07-04 Thread newspost2012
Am Donnerstag, 4. Juli 2013 19:20:43 UTC+2 schrieb Arturo B: > ... > So I want to question: > How is the > > if 'h' in consonants else 'h' for 'h' in s > > part evaluated? (step by step please :P ) Although new to python I think I can solve this (if no one contradicts, I can guess that I under

Re: How is this evaluated

2013-07-04 Thread Antoon Pardon
Op 04-07-13 19:20, Arturo B schreef: I'm making this exercise: (Python 3.3) Write a function translate() that will translate a text into "rövarspråket" (Swedish for "robber's language"). That is, double every consonant and place an occurrence of "o" in between. For example, translate("this is

How is this evaluated

2013-07-04 Thread Arturo B
I'm making this exercise: (Python 3.3) Write a function translate() that will translate a text into "rövarspråket" (Swedish for "robber's language"). That is, double every consonant and place an occurrence of "o" in between. For example, translate("this is fun") should return the string "tothoh