我想用字符串列出元组列表.基本上,给出以下内容,
s = "a b c d" w = s.split()
我想要下面的元组列表:
[(a, b), (b, c), (c, d)]
我觉得我应该使用append函数和for循环,但我被卡住了.我该怎么做?
python string tuples list
list ×1
python ×1
string ×1
tuples ×1