Updated python.md

Provided correct description for list elements replacement
This commit is contained in:
Vlad Silverman 2019-08-12 15:41:46 -07:00 committed by GitHub
parent 090d42f103
commit 2175c6275c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,7 @@ category: Python
list[:-1] # returns all but the last element list[:-1] # returns all but the last element
list[i] = val list[i] = val
list[i:j] = otherlist # replace ith to jth element with otherlist list[i:j] = otherlist # replace ith to jth-1 elements with otherlist
del list[i:j] del list[i:j]
list.append(item) list.append(item)