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:
>
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
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
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)