Mar-29-2017, 11:48 PM
Hi... I am relatively new to Python. I am trying to sort a list of tuples - each tuple contains a boolean variable and
a string. I'd like to use the list sort() method... I'm a little confused if I need to use a lambda or use key= or maybe
even cmd= I'd like to really do a comparison like cmp((is_present, element.text), (is_present, element.text)) or
something similar to compare the tuples. I'm just starting out in my journey with Python so any help or advice
you can give would be great.
a string. I'd like to use the list sort() method... I'm a little confused if I need to use a lambda or use key= or maybe
even cmd= I'd like to really do a comparison like cmp((is_present, element.text), (is_present, element.text)) or
something similar to compare the tuples. I'm just starting out in my journey with Python so any help or advice
you can give would be great.