Re: [Tutor] how-to generate specific lines of text from two python lists

2017-06-26 Thread Mats Wichmann
On 06/25/2017 12:44 PM, Tahir Hafiz wrote: > Thanks Alan and Peter, > > Alan you are right this could be solved via an SQL statement but I was > asked to finish the python script. > Anyways, this worked and helped to solve the problem in the end: > > # Create iterator object, dictionary which can

Re: [Tutor] custom comparator with ordered list

2017-06-26 Thread Mats Wichmann
On 06/26/2017 10:38 AM, Anish Kumar wrote: > >> anish singh wrote: >> >>> I need a custom comparator. >>> >>> dictionary = {a:[b,c], d:[e,f]} >>> >>> If both 'b' and 'e' belong to the same bin if would help alot if your problem statement included a description of what "same bin" is. > Well no, t

Re: [Tutor] custom comparator with ordered list

2017-06-26 Thread Peter Otten
Anish Kumar wrote: > >> anish singh wrote: >> >>> I need a custom comparator. >>> >>> dictionary = {a:[b,c], d:[e,f]} >>> >>> If both 'b' and 'e' belong to the same bin >>> then it should be compared based on 'c' and 'f'. >>> >>> However, I want to also represent the result of the >>> sorted

Re: [Tutor] custom comparator with ordered list

2017-06-26 Thread Anish Kumar
> anish singh wrote: > >> I need a custom comparator. >> >> dictionary = {a:[b,c], d:[e,f]} >> >> If both 'b' and 'e' belong to the same bin >> then it should be compared based on 'c' and 'f'. >> >> However, I want to also represent the result of the >> sorted operation in a ordered dictionary

Re: [Tutor] custom comparator with ordered list

2017-06-26 Thread Peter Otten
anish singh wrote: > I need a custom comparator. > > dictionary = {a:[b,c], d:[e,f]} > > If both 'b' and 'e' belong to the same bin > then it should be compared based on 'c' and 'f'. > > However, I want to also represent the result of the > sorted operation in a ordered dictionary as order is >

[Tutor] custom comparator with ordered list

2017-06-26 Thread anish singh
I need a custom comparator. dictionary = {a:[b,c], d:[e,f]} If both 'b' and 'e' belong to the same bin then it should be compared based on 'c' and 'f'. However, I want to also represent the result of the sorted operation in a ordered dictionary as order is important. My custom comparator is som

Re: [Tutor] joining Indic and English Text

2017-06-26 Thread Peter Otten
Evuraan wrote: > Greetings! > > I've a case where I need to put lines with both Indic and English Text > to a file ( and optionally to stdout): With... > What am I doing wrong? My locale and LANG (en_US.UTF-8) etc seem to be > setup. > When I attempt this in python3: ...that... > ml_text = u