- 博客(2)
- 收藏
- 关注
原创 Move Zeros
给定一个数组nums,写一个函数,将数组中所有的0挪到数组的末尾,⽽维持其他所有非0元素的相对位置。举例: nums = [0, 1, 0, 3, 12],函数运⾏后结果为[1, 3, 12, 0, 0]解法一思路:创建一个临时数组nonZeroElements,遍历nums,将nums中非0元素赋值到nonZeroElements中,而后按顺序将nonZeroElements赋值到nums...
2020-02-22 22:47:18 167
原创 vim写python时:line 1: syntax error near unexpected token
line 1: syntax error near unexpected tokenPermission denied以test.py为例,脚本内容如下:def test(): print 'hello, world'if __name__ == "__main__": test()运行脚本:python test.py输出:hello, wo...
2019-10-20 21:41:28 2167 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人