Re: Find 6-letter words that are hidden (embedded) within

2023-02-24 Thread Pancho via Python-list
On 24/02/2023 18:34, Hen Hanna wrote: i just wrote a program, which... within[FunFunPython] finds: (funny,futon,python) ( 5- and 6- letter words ) (my program uses a Trie, but is pretty simple)

Re: Need max values in list of tuples, based on position

2022-11-13 Thread Pancho via Python-list
On 11/11/2022 19:56, DFS wrote: Edit: found a solution online: - x = [(11,1,1),(1,41,2),(9,3,12)] maxvals = [0]*len(x[0]) for e in x: maxvals = [max(w,int(c)) for w,c in zip(maxvals,e)] print(maxvals) [11,41,12]

Re: Need max values in list of tuples, based on position

2022-11-11 Thread Pancho via Python-list
On 11/11/2022 20:58, Thomas Passin wrote: On 11/11/2022 2:22 PM, Pancho via Python-list wrote: On 11/11/2022 18:53, DFS wrote: On 11/11/2022 12:49 PM, Dennis Lee Bieber wrote: On Fri, 11 Nov 2022 02:22:34 -0500, DFS declaimed the following: [(0,11), (1,1),  (2,1),   (0,1) , (1,41), (2,2

Re: Need max values in list of tuples, based on position

2022-11-11 Thread Pancho via Python-list
On 11/11/2022 07:22, DFS wrote: [(0,11), (1,1),  (2,1),  (0,1) , (1,41), (2,2),  (0,9) , (1,3),  (2,12)] The set of values in elements[0] is {0,1,2} I want the set of max values in elements[1]: {11,41,12} def build_max_dict( tups): dict = {} for (a,b) in tups: if (a in

Re: Need max values in list of tuples, based on position

2022-11-11 Thread Pancho via Python-list
On 11/11/2022 18:53, DFS wrote: On 11/11/2022 12:49 PM, Dennis Lee Bieber wrote: On Fri, 11 Nov 2022 02:22:34 -0500, DFS declaimed the following: [(0,11), (1,1),  (2,1),   (0,1) , (1,41), (2,2),   (0,9) , (1,3),  (2,12)] The set of values in elements[0] is {0,1,2} I want the set of max