list2007 = []
for i in range(len(res2007)):
a = res2007[i][0]
list2007.append(a)
set2007 = set([list2007])
TypeError Traceback (most recent call last)
in ()
----> 1 set2007 = set([list2007])
TypeError: 'tuple' object is not callable
For your information, res2007 is also a list type.
list set convert python3
You can do it as below.
L = list(range(10))
print(set(L))
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
© 2024 OneMinuteCode. All rights reserved.