摘要: # 逆向循环: >>> ListA = [0, 1, 2, 1, 4, 1, 6, 1, 8, 1] >>> for i in reversed(range(len(ListA))): ... print(i) ... 9 8 7 6 5 4 3 2 1 0 # 正向循环 >>> ListA = [ 阅读全文
posted @ 2022-01-05 11:26 MoKin_Li 阅读(712) 评论(0) 推荐(0)
摘要: class Solution: def removeElement(self, nums: List[int], val: int) -> int: while val in nums: nums.remove(val) return len(nums) remove()方法在使用过程中,往往需要结 阅读全文
posted @ 2022-01-05 11:07 MoKin_Li 阅读(37) 评论(0) 推荐(0)