-1

I have

list1 = [[50,0.43],[45,0.66]]

And I want to get all the second elements in each array so I would like:

[0.43,0.66]

Also, if I want to check if 50 is in list1, how do I do that? Because using

50 in list1

returns False.

martineau
  • 112,593
  • 23
  • 157
  • 280

1 Answers1

-1

1.

for i in list1[1]:
    print(i)

2.

50 in list1[0]

Remember there are 2 list in list1. Which means they are list of list.

Panduka Nandara
  • 464
  • 5
  • 14