列表中的每个项目的第二个列表,xs.运行下面的代码,python给我'无'
xs = [12, 10, 32, 3, 66, 17, 42, 99, 20]
a = [b**2 for b in xs]
c = (a + xs).sort()
print(c, end=', ')
Run Code Online (Sandbox Code Playgroud)
相同的列表但不同的代码 -
xs = [12, 10, 32, 3, 66, 17, 42, 99, 20]
a = [b**2 for b in xs]
c = a + xs
c.sort()
print(c, end=', ')
Run Code Online (Sandbox Code Playgroud)
... python给了我列表(c),全部排序.我不明白.或者有更多的pythonic方式来做到这一点?
谢谢!