Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个字符串“hello world”,我把它做成了一个需要修改成元组的列表。我有点卡在代码上,希望有人能帮助我。
s1=str("hello world") L1= list(s1) print type (L1) list print L1(5)
s1="hello world" L1=s1.split(" ") t1=tuple(L1) print type(t1) tuple print(t1) ('hello', 'world')
我想我也找到了另一种方法。
s1= str("hello world") L1= list(s1) print type (L1) print L1