I have two lists: list1=["a","b","c","d"]
and list2=["z","y","x","w"]
.
I would like to take a random element list1
and place it in list2[1]
.
I write list2.insert(1,random.sample(list1,1))
but I receive['z',['b'],'y','x','w']
How do I remove parentheses around 'b'
?
source
to share