Re: Cleaning up conditionals

2016-12-31 Thread Jussi Piitulainen
Deborah Swanson writes: > Jussi Piitulainen wrote: >> Sent: Saturday, December 31, 2016 8:30 AM >> Deborah Swanson writes: >> >> > Is it possible to use some version of the "a = expression1 if >> > condition else expression2" syntax with an elif? And for >> > expression1 and expression2 to be sin

RE: Cleaning up conditionals

2016-12-31 Thread Steve D'Aprano
On Sun, 1 Jan 2017 02:58 pm, Deborah Swanson wrote: >> It's possible to select either l1 or l2 using an expression, >> and then subscript that with [v]. However, this does not >> usually make for readable code, so I don't recommend it. >> >> (l1 if whatever else l2)[v] = new_value >> >> ChrisA >

Re: Cleaning up conditionals

2016-12-31 Thread Chris Angelico
On Sun, Jan 1, 2017 at 2:58 PM, Deborah Swanson wrote: > I'm not sure I understand what you did here, at least not well enough to > try it. > > What conditional can I do between the 2 rows of listings (the list names > l1 and l2) that will give me which row has the value to copy from and > which o

RE: Cleaning up conditionals

2016-12-31 Thread Deborah Swanson
Dennis Lee Bieber > Sent: Saturday, December 31, 2016 7:29 PM > > On Sat, 31 Dec 2016 14:35:46 -0800, "Deborah Swanson" > declaimed the following: > > >Here's the function I have so far: > > > >def comprows(l1,l2,st,ki,no): > >ret = '' > >labels = {st: 'st/co', ki: 'kind', no: 'notes'}

RE: Cleaning up conditionals

2016-12-31 Thread Deborah Swanson
Chris Angelico wrote: > Sent: Saturday, December 31, 2016 2:19 PM > > On Sun, Jan 1, 2017 at 9:03 AM, Deborah Swanson > wrote: > > And didn't finish it because I couldn't see what a should > be. I want > > it to be l2[v] if the first clause is true, and l1[v] if > the second. > > If I was co

RE: Cleaning up conditionals

2016-12-31 Thread Peter Otten
Deborah Swanson wrote: > Peter Otten wrote: >> Deborah Swanson wrote: >> >> > Here I have a real mess, in my opinion: >> >> [corrected code:] >> >> > if len(l1[st]) == 0: >> > if len(l2[st]) > 0: >> > l1[st] = l2[st] >> > elif len(l2[st]) == 0: >> >

RE: learning and experimenting python.

2016-12-31 Thread Deborah Swanson
Erik wrote: > Yes, my message was to everyone, using a quote from > 'einstein1410' that > I thought demonstrated the point. > > The vast majority of the messages in this thread are from > 'einstein' nd > are short, nonsensical retorts to others who are trying to be > helpful, > that just see

Re: OT: Re: learning and experimenting python.

2016-12-31 Thread Gregory Ewing
mm0fmf wrote: Username einstein, asking bizarre questions, short responses with no included context. if this isn't trolling I'm a Dutchman. I don't think he's trolling, I think he's using some kind of forum interface (Google Groups?) that displays whole threads together, making quoting less nec

Re: learning and experimenting python.

2016-12-31 Thread Gregory Ewing
Joel Goldstick wrote: In the United States, ambulances often have their signage written backwards so that it appears normal in a rear view mirror. Do they do that in other countries? In NZ our fire engines have FIRE written both forwards and backwards on the front, so it's readable either way.

Re: [SPAM] RE: Cleaning up conditionals

2016-12-31 Thread MRAB
On 2016-12-31 22:35, Deborah Swanson wrote: Peter Otten wrote: Deborah Swanson wrote: > Here I have a real mess, in my opinion: [corrected code:] > if len(l1[st]) == 0: > if len(l2[st]) > 0: > l1[st] = l2[st] > elif len(l2[st]) == 0: > i

Re: learning and experimenting python.

2016-12-31 Thread Steve D'Aprano
On Sun, 1 Jan 2017 06:34 am, Dennis Lee Bieber wrote: > On Sat, 31 Dec 2016 15:41:09 +, mm0fmf declaimed > the following: > > >>That could explain why there are so many crashes in the US, the drivers >>are looking at the road right in front of the hood/bonnet This fortunately is not a pro

RE: Cleaning up conditionals

2016-12-31 Thread Deborah Swanson
Peter Otten wrote: > Deborah Swanson wrote: > > > Here I have a real mess, in my opinion: > > [corrected code:] > > > if len(l1[st]) == 0: > > if len(l2[st]) > 0: > > l1[st] = l2[st] > > elif len(l2[st]) == 0: > > if len(l1[st]) > 0: > >

Re: Cleaning up conditionals

2016-12-31 Thread Chris Angelico
On Sun, Jan 1, 2017 at 9:03 AM, Deborah Swanson wrote: > And didn't finish it because I couldn't see what a should be. I want it > to be > l2[v] if the first clause is true, and l1[v] if the second. If I was > computing a value, this would work beautifully, but I don't see how it > can if I'm choo

RE: Cleaning up conditionals

2016-12-31 Thread Deborah Swanson
Jussi Piitulainen wrote: > Sent: Saturday, December 31, 2016 8:30 AM > Deborah Swanson writes: > > > Is it possible to use some version of the "a = expression1 if > > condition else expression2" syntax with an elif? And for > expression1 > > and expression2 to be single statements? That's the

Re: Cleaning up conditionals

2016-12-31 Thread Tim Chase
On 2016-12-30 19:59, Deborah Swanson wrote: > Similar, actually the same as Cameron suggested. I really need to > revisit testing for empty. I probably rejected it early on for some > bad reason (you don't understand everything that goes wrong when > you're learning). If your data is anything like

RE: Cleaning up conditionals

2016-12-31 Thread Deborah Swanson
> From: Tim Chase > Sent: Saturday, December 31, 2016 12:41 PM > On 2016-12-30 19:59, Deborah Swanson wrote: > > Similar, actually the same as Cameron suggested. I really need to > > revisit testing for empty. I probably rejected it early on for some > > bad reason (you don't understand everythin

RE: Cleaning up conditionals

2016-12-31 Thread Deborah Swanson
Jussi Piitulainen wrote: > Sent: Saturday, December 31, 2016 8:30 AM > Deborah Swanson writes: > > > Is it possible to use some version of the "a = expression1 if > > condition else expression2" syntax with an elif? And for > expression1 > > and expression2 to be single statements? That's the

Re: learning and experimenting python.

2016-12-31 Thread Joel Goldstick
On Sat, Dec 31, 2016 at 12:08 PM, wrote: > We are not discussing here about English, > But for python. Don't divert. Other wise someone thinks that I am doing this > for getting more posts. > -- > https://mail.python.org/mailman/listinfo/python-list If you stay around a while, einstein, you wil

OT: Re: learning and experimenting python.

2016-12-31 Thread mm0fmf
On 31/12/2016 17:08, einstein1...@gmail.com wrote: We are not discussing here about English, But for python. Don't divert. Other wise someone thinks that I am doing this for getting more posts. Username einstein, asking bizarre questions, short responses with no included context. if this isn

Re: learning and experimenting python.

2016-12-31 Thread einstein1410
We are not discussing here about English, But for python. Don't divert. Other wise someone thinks that I am doing this for getting more posts. -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-31 Thread mm0fmf
On 31/12/2016 15:46, Ian Kelly wrote: On Dec 31, 2016 1:48 AM, "mm0fmf" wrote: On 30/12/2016 17:50, einstein1...@gmail.com wrote: Hello everyone, I am the new comer and learner of python. I have a doubt that when I type python and press enter it shows a prompt like But why it is >>> ? Is

Re: Cleaning up conditionals

2016-12-31 Thread Jussi Piitulainen
Deborah Swanson writes: > Is it possible to use some version of the "a = expression1 if > condition else expression2" syntax with an elif? And for expression1 > and expression2 to be single statements? That's the kind of > shortcutting I'd like to do, and it seems like python might be able to > d

Re: Cleaning up conditionals

2016-12-31 Thread Peter Otten
Deborah Swanson wrote: > Here I have a real mess, in my opinion: [corrected code:] > if len(l1[st]) == 0: > if len(l2[st]) > 0: > l1[st] = l2[st] > elif len(l2[st]) == 0: > if len(l1[st]) > 0: > l2[st] = l1[st] > Anybody kn

Re: learning and experimenting python.

2016-12-31 Thread Ian Kelly
On Dec 31, 2016 3:12 AM, wrote: That's true. Please include quoted context in your replies. I have no idea who or what you're responding to. -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-31 Thread Ian Kelly
On Dec 31, 2016 1:48 AM, "mm0fmf" wrote: On 30/12/2016 17:50, einstein1...@gmail.com wrote: > Hello everyone, > I am the new comer and learner of python. > I have a doubt that when I type python and press enter it shows a prompt > like > >> But why it is >>> ? > Is there any special reason?

Re: learning and experimenting python.

2016-12-31 Thread mm0fmf
On 31/12/2016 15:27, Dennis Lee Bieber wrote: On Sat, 31 Dec 2016 12:04:57 +, mm0fmf declaimed the following: Though they do write road info upside down on the road surface, typically XING with PED underneath. I had to ask what XINGPED meant till my colleague driving said it was PEDXING, p

Re: learning and experimenting python.

2016-12-31 Thread Joel Goldstick
On Sat, Dec 31, 2016 at 10:27 AM, Dennis Lee Bieber wrote: > On Sat, 31 Dec 2016 12:04:57 +, mm0fmf declaimed the > following: > >>Though they do write road info upside down on the road surface, >>typically XING with PED underneath. I had to ask what XINGPED meant till >>my colleague driving

Re: learning and experimenting python.

2016-12-31 Thread einstein1410
I warn you that I am not playing game here. Please be cautioned. And if you think so, why post here? Its seems that you are also interested in doing so. -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-31 Thread Marko Rauhamaa
mm0fmf : > On 31/12/2016 09:58, Steve D'Aprano wrote: >> On Sat, 31 Dec 2016 07:30 pm, mm0fmf wrote: >> >>> On 30/12/2016 17:50, einstein1...@gmail.com wrote: >>> "I have a doubt" is not the correct way to ask this kind of question in >>> English. >> >> But it is perfectly idiomatic Indian English

Re: learning and experimenting python.

2016-12-31 Thread mm0fmf
On 31/12/2016 09:58, Steve D'Aprano wrote: On Sat, 31 Dec 2016 07:30 pm, mm0fmf wrote: On 30/12/2016 17:50, einstein1...@gmail.com wrote: Hello everyone, I am the new comer and learner of python. I have a doubt [...] "I have a doubt" is not the correct way to ask this kind of question in En

Re: learning and experimenting python.

2016-12-31 Thread Erik
On 31/12/16 05:22, Wildman via Python-list wrote: On Fri, 30 Dec 2016 19:23:17 -0700, Michael Torrie wrote: On 12/30/2016 07:05 PM, Wildman via Python-list wrote: On Fri, 30 Dec 2016 23:39:43 +, Erik wrote: Do not feed the troll. E. Please explain how what I said is trolling. Perhaps

Re: learning and experimenting python.

2016-12-31 Thread einstein1410
I will You can't stop me. -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-31 Thread einstein1410
That's true. -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-31 Thread Steve D'Aprano
On Sat, 31 Dec 2016 07:30 pm, mm0fmf wrote: > On 30/12/2016 17:50, einstein1...@gmail.com wrote: >> Hello everyone, >> I am the new comer and learner of python. >> I have a doubt [...] > "I have a doubt" is not the correct way to ask this kind of question in > English. But it is perfectly idiom

Re: learning and experimenting python.

2016-12-31 Thread Steve D'Aprano
On Sat, 31 Dec 2016 07:27 pm, einstein1...@gmail.com wrote: > It is moderatable. You can delete your all messages except topics. What *are* you talking about? Do you realise that your messages go to at least one mailing list (python-list@python.org), at least two news groups (comp.lang.python an

RE: Cleaning up conditionals

2016-12-31 Thread Steve D'Aprano
On Sat, 31 Dec 2016 11:26 am, Deborah Swanson wrote: > As Mr. Bieber points out, what I had above greatly benefits from the use > of conjunctions. It now reads: > > if not len(l1[st]) and len(l2[st]): > l1[st] = l2[st] > elif not len(l2[st]) and len(l1[st]): > l2[st] = l1[st] Your code c

Re: learning and experimenting python.

2016-12-31 Thread einstein1410
Thanks for suggesting me how to ask. Thanks a lot. -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-31 Thread einstein1410
Sorry for that. -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-31 Thread mm0fmf
On 30/12/2016 17:50, einstein1...@gmail.com wrote: Hello everyone, I am the new comer and learner of python. I have a doubt that when I type python and press enter it shows a prompt like But why it is >>> ? Is there any special reason? Why it is not setted as @,& or any other special character

Re: learning and experimenting python.

2016-12-31 Thread km
You are wasting our time instead of learning python. On Dec 31, 2016 2:09 PM, wrote: > It is moderatable. You can delete your all messages except topics. > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-31 Thread einstein1410
I am not feeding the troll. -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-31 Thread einstein1410
It is moderatable. You can delete your all messages except topics. -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-31 Thread einstein1410
Look I am not feeding trolls. Please be aware. -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-31 Thread einstein1410
Nice information. Thanks a lot. Krunalkumar Shah -- https://mail.python.org/mailman/listinfo/python-list