'NoneType' object is not subscriptable

这个方程是为了计算一个list中最大值和最小值的差
提示error是'NoneType' object is not subscriptable
请问哪里有问题

img

x.sort()是把列表“就地排序”,没有返回值
要么单独写一行
x.sort()
要么使用sorted()
x = sorted(x)