I am trying to convert a two nested list of lists into a nested list of tuples in Python. But I cant get the desired result.
The input looks like:
first_list = [['best', 'show', 'ever', '!'],
['its', 'a', 'great', 'action','movie']]
second_list = [['O', 'B_A', 'O', 'O'],
['O', 'O', 'O', 'B_A','I_A']]
The desired output should look like:
result = [[('best','O'),('show','B_A'),('ever','O'),('!','O')],
[('its','O'),('a','O'),('great','O'),('action','B_A'),('movie','I_A')]]
Thank you in advance!
question from:
https://stackoverflow.com/questions/65838307/how-to-convert-a-two-nested-list-of-lists-into-a-nested-list-of-tuples-in-python 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…