Answers for "python method to remove last"

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 last item from list python

even_numbers = [2,4,6,8,10,12,15]	# 15 is an odd number
# if you wanna remove 15 from the list 
even_numbers.pop()
Posted by: Guest on March-04-2021

Python Answers by Framework

Browse Popular Code Answers by Language