Python使用解析的方法创建一个列表,列表里是1到100之内的所有奇数 list_a=[x for x in range(1,101,2) if x%1==0] print(list_a) 输出结果: <