Re: [Tutor] How can I find a group of characters in a list of strings?

2018-07-25 Thread Steven D'Aprano
On Wed, Jul 25, 2018 at 05:29:27PM -0700, Martin A. Brown wrote: > If I only had to do this once, over only a million items (given > today's CPU power), so I'd probably do something like the below > using sets. The problem with sets is that they collapse multiple instances of characters to a

Re: [Tutor] How can I find a group of characters in a list of strings?

2018-07-25 Thread Jim
On 07/25/2018 07:29 PM, Martin A. Brown wrote: I have a list of strings that contains slightly more than a million items. Each item is a string of 8 capital letters like so: ['MIBMMCCO', 'YOWHHOY', ...] I need to check and see if the letters 'OFHCMLIP' are one of the items in the list but the

Re: [Tutor] How can I find a group of characters in a list of strings?

2018-07-25 Thread Jim
On 07/25/2018 07:43 PM, Steven D'Aprano wrote: On Wed, Jul 25, 2018 at 06:50:56PM -0500, Jim wrote: [...] I need to check and see if the letters 'OFHCMLIP' are one of the items in the list but there is no way to tell in what order the letters will appear. So I can't just search for the string 'O

Re: [Tutor] How can I find a group of characters in a list of strings?

2018-07-25 Thread Martin A. Brown
> I have a list of strings that contains slightly more than a > million items. Each item is a string of 8 capital letters like so: > > ['MIBMMCCO', 'YOWHHOY', ...] > > I need to check and see if the letters 'OFHCMLIP' are one of the items in the > list but there is no way to tell in what order t

Re: [Tutor] How can I find a group of characters in a list of strings?

2018-07-25 Thread Steven D'Aprano
On Wed, Jul 25, 2018 at 06:50:56PM -0500, Jim wrote: [...] > I need to check and see if the letters 'OFHCMLIP' are one of the items > in the list but there is no way to tell in what order the letters will > appear. So I can't just search for the string 'OFHCMLIP'. I just need to > locate any str

Re: [Tutor] How can I find a group of characters in a list of strings?

2018-07-25 Thread Mats Wichmann
On 07/25/2018 05:50 PM, Jim wrote: > Linux mint 18 and python 3.6 > > I have a list of strings that contains slightly more than a million > items. Each item is a string of 8 capital letters like so: > > ['MIBMMCCO', 'YOWHHOY', ...] > > I need to check and see if the letters 'OFHCMLIP' are one of

[Tutor] How can I find a group of characters in a list of strings?

2018-07-25 Thread Jim
Linux mint 18 and python 3.6 I have a list of strings that contains slightly more than a million items. Each item is a string of 8 capital letters like so: ['MIBMMCCO', 'YOWHHOY', ...] I need to check and see if the letters 'OFHCMLIP' are one of the items in the list but there is no way to t

Re: [Tutor] images

2018-07-25 Thread Beck, Caroline
Hi! I am a student working on a game in which I am trying to use a gif as my turtle. Currently, the turtle moves around the screen with the arrow keys, but the gif does not move with it. Below is how I have tried to tell the code that the gif is the turtle, but the code is not reading that the g