Issue
Suppose I have the following arrays
a = [1, 2, 3]
b = [4, 5, 6]
And I created the list
c = [(1,4), (1,5), (1,6), (2,4), (3,5), (2,6), (3,4), (3,5), (3,6)]
How can I create two lists as follows:
a = [1, 1, 1, 2, 2, 2, 3, 3, 3]
b = [4, 5, 6, 4, 5, 6, 4, 5, 6]
Solution
a=[]
b=[]
for i in c:
a.append(i[0])
b.append(i[1])
Answered By - Dams
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.