Answers for "remove last character from string in list 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 "remove last character from string in list python"

Python Answers by Framework

Browse Popular Code Answers by Language