Q:

List of lists middle element extraction in python

I have a list of lists as follows
[('trojan', 'virus', 0.4731800100841465), ('elb', 'Ebola', 0.3722390506633956)]

How to extract only the middle element i.e. 'virus' and 'Ebola' ?

A:

You can use a comprehnesion list
your_list = [('trojan', 'virus', 0.4731800100841465), ('elb', 'Ebola', 0.3722390506633956)]
l = [x[1] for x in your_list]

output:
['virus', 'Ebola']

