Re: [Tutor] advice on idiom replacing if test requested

2005-12-11 Thread Brian van den Broek
Danny Yoo said unto the world upon 2005-12-11 22:13: > > On Sun, 11 Dec 2005, Brian van den Broek wrote: > > >>I have a case like this toy code: >> >>import random >>list1 = [1,2,3] >>list2 = ['a', 'b', 'c'] >>item = random.choice(list1 +list2) >>if item in list1: >> others = list2 >>else: >

Re: [Tutor] advice on idiom replacing if test requested

2005-12-11 Thread Danny Yoo
On Sun, 11 Dec 2005, Brian van den Broek wrote: > I have a case like this toy code: > > import random > list1 = [1,2,3] > list2 = ['a', 'b', 'c'] > item = random.choice(list1 +list2) > if item in list1: > others = list2 > else: > others = list1 Hi Brian, This code works, and as long

Re: [Tutor] advice on idiom replacing if test requested

2005-12-11 Thread bob
At 04:15 PM 12/11/2005, Brian van den Broek wrote: >Hi all, > >I have a case like this toy code: > >import random >list1 = [1,2,3] >list2 = ['a', 'b', 'c'] >item = random.choice(list1 +list2) >if item in list1: > others = list2 >else: > others = list1 > > >Another way occurred to me, but

[Tutor] advice on idiom replacing if test requested

2005-12-11 Thread Brian van den Broek
Hi all, I have a case like this toy code: import random list1 = [1,2,3] list2 = ['a', 'b', 'c'] item = random.choice(list1 +list2) if item in list1: others = list2 else: others = list1 Another way occurred to me, but I wonder if I'm being too cute: item = random.choice(list1 +list2)

Re: [Tutor] information needed to make a connection between computers

2005-12-11 Thread Danny Yoo
[Taking catalog-sig and python-list out of CC.] John, please don't crosspost. catalog-sig in particular is off-topic of your question. When we crosspost, we add noise to those lists and frustrate members of the community. It's generally a bad thing to do. See: http://catb.org/~esr/faqs/sm

[Tutor] information needed to make a connection between computers

2005-12-11 Thread John Walton
 Hello again! I'm still working on that instant messenger (for science fair), and I have been reading about networking in some Java tutorials. In one part of it, it said to have a connection with another computer, you need to know the IP name of the computer you want to connect with. I don't kn

Re: [Tutor] bnf

2005-12-11 Thread Alan Gauld
> ::= is bnf notation for "is defined as" > > please spend that extra minute googling before > you bother all the nice people on this list. To be fair, unless you knew that it was BNF I doubt you'd find much by Googling. I tried several variations of '::=' etc and Google came back empty. Once