Python将两个列表合并为两个元组的元组

时间:2017-04-10 17:57:56

标签: python list tuples

我想将两个列表合并为两个元组的元组

tup_of_2_tups = ((1,'one'),(2,'two'),(3,'three'),
                 (4,'four'),(5,'five'))

期望的输出:

this.setState({
   depStation: selected
}, () => {
  // here you will get your depStation state value
  console.log(this.state.depStation,"depStation value")
});

1 个答案:

答案 0 :(得分:2)

归功于@WillemVanOnsem:

output = tuple(zip(lst1,lst2))