有个多层列表:[1, 2, 3, 4, [5, 6, [7, 8]], ['a', 'b', [2, 4]]],拆分成单层列表 使用内置方法 结果和原列表顺序不同 def split(li): pop_index_list = [] # 用来存储需要删除元素的索引 for ele in li: if isinstance(ele, list): pop_index_list.insert(0, li.index(ele)) li.extend(ele) for i in pop_index_li…
CREATE FUNCTION [dbo].[Split](@separator VARCHAR(64)=',',@string NVARCHAR(MAX)) RETURNS @ResultTab TABLE ( Id INT , Res NVARCHAR(500) ) AS BEGIN DECLARE @Num INT IF(@string IS NOT NULL AND @string <> '' AND LEN(@string)>0…
D:\>python Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. #2.1序列概览 >>> edward=['Edward Gumby', 4…