我希望将包含48种不同长度的列表拆分为每个项目长度的新列表.我可以做点什么
for item in list:
if len(item) == 1:
len1list.append(item)
if len(item) == 2:
len2list.append(item)
Run Code Online (Sandbox Code Playgroud)
等等,但这需要48个if语句,只是想知道是否有更多的Pythonic方式,使用更少的代码行.