Answers for "how to delete the last character of a list in python"

64

python remove last character from string

str =  "string"
str = str[:-1]  # Returns "strin"
Posted by: Guest on July-25-2020
0

how to remove the last item in a list python

myList = [8, 2, 19, 6, 14]
myList.remove(myList[-1])
print(myList)
Posted by: Guest on July-18-2021

Code answers related to "how to delete the last character of a list in python"

Python Answers by Framework

Browse Popular Code Answers by Language