How to remove last character from Python string? Subash Chandran 17th December 2020 Leave a Comment Advertisements We can use the slicing in Python to remove the last character from a string in Python. name = 'Poopcode' print(name[:-1]) #Poopcod print(name[:-2]) #Poopco Curly hair, very fair, please share 🙂Click to share on Twitter (Opens in new window)Click to share on Facebook (Opens in new window)Click to share on Reddit (Opens in new window)Click to share on Telegram (Opens in new window)Click to share on WhatsApp (Opens in new window)Click to email this to a friend (Opens in new window) Snippets Convert a date to its ISO-8601 equivalent in Python, Convert a dictionary to a list of tuples in Python, convert date to iso format python, convert dictionary to list python, Convert RGB to Hex in Python, convert rgb to hex python, date to iso format in python, day weekend or weekday python, decimal to binary python, decimal to hex python, decimal to hexadecimal python, Flatten a list of lists in Python, flatten list of lists python, get unique elements from array, get unique elements python, How to remove last character from Python string?, Learn how to check if a day is weekday or weekend in Python., list set python, list transpose python, merge two dictionaries in python, Merge two dictionaries into one in Python, remove duplicates list, remove last character python, reverse a decimal number in python, reverse a float number in python, reverse a number in python, Shuffle a list using Fisher-Yates algorithm in Python, shuffle list python, Sort a dictionary by key in Python, transpose a list in python Change font size A Decrease font size. A Reset font size. A Increase font size.