0
Python lists
b=[(1,12),(2,14),(3,11),(4,18)] I want to write a code that gives me the second number in every columns: 12 , 14, 11, 18 I tried this code but I didnât get my desired answer: b[0:][1] I will be grateful if someone helps me
3 RĂ©ponses
+ 3
b = [i[1] for i in b]
0
Thanks!
0
If you want your output in the form of list,
z=[b[i][1] for i in range(len(b))]
print(z)