I have two lists such as:
l_one = [2,5,7,9,3]
l_two = [4,6,9,11,4]
…and I need to find the min and max value from both lists combined. That is, I want to generate a single min and a single max value.
My question is – what is the most pythonic way to achieve this?
Any help much appreciated.
Arguably the most readable way is
or
It will copy the lists, though, since
l_one + l_twocreates a new list. To avoid copying, you could do