Answers for "delete the last value of string in python"

6

how to remove the last letter of a string python

string = "Hello World"
string = string[:-1]  # This overwrite the string to have the last letter removed.
print(string)# Then we print the variable string
Posted by: Guest on February-25-2021

Code answers related to "delete the last value of string in python"

Python Answers by Framework

Browse Popular Code Answers by Language