Normally, you would just do:

s = s[:-3] + s[-2:]

The s[:-3] gives you a string up to, but not including, the comma you want removed ("this is a string") and the s[-2:] gives you another string starting one character beyond that comma (" a").

Then, joining the two strings together gives you what you were after ("this is a string a").

Answer from Anurag Uniyal on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › python › string-slicing-in-python
String Slicing in Python - GeeksforGeeks
String slicing in Python is a way to get specific parts of a string by using start, end and step values. It’s especially useful for text manipulation and data parsing. ... Explanation: In this example, we used the slice s[0:5] to obtain the ...
Published: July 12, 2025
🌐
W3Schools
w3schools.com › python › gloss_python_string_slice.asp
Python Slice Strings
Remove List Duplicates Reverse a String Add Two Numbers · Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Practice Problems Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Training ... You can return a range of characters by using the slice syntax.
Discussions

Advanced slicing rules?
So I’m taking a quiz and the first question asks something that was never written or spoken once in the section on lists as they pertain to slicing… which is absolutely infuriating as I am someone who tries to understand EVERYTHING before moving on: Question 1: What are the values of list_b ... More on discuss.python.org
🌐 discuss.python.org
19
1
August 14, 2022
A Comprehensive Guide to Slicing in Python
The start/end indexing when going in reverse has always taken a level of extra mental effort that I don't like. Like excluding the first and last item using [1:-1] is intuitive to me, but doing the same in reverse by doing [-2:0:-1] annoys me (though I do get why its like that). That is why I tend to do [1:-1][::-1] instead. More on reddit.com
🌐 r/Python
40
356
February 1, 2022
🌐
W3Schools
w3schools.com › python › python_strings_slicing.asp
Python - Slicing Strings
Remove List Duplicates Reverse a String Add Two Numbers · Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Practice Problems Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Training ... You can return a range of characters by using the slice syntax.
🌐
Akamai
akamai.com › cloud › guides › how-to-slice-and-index-strings-in-python
How to Slice and Index Strings in Python | Linode Docs
January 28, 2022 - Python string indexing can also be used to extract a substring from a larger string. This process is referred to as slicing. To use Python to slice a string from a parent string, indicate the range of the slice using a start index and an end index.
🌐
Medium
medium.com › @ghoshsiddharth25 › python-strings-slicing-methods-formatting-internals-c0d407fa1646
Python Strings — Slicing, Methods, Formatting & Internals | by Siddharth Ghosh | Medium
July 25, 2026 - A string is a sequence of Unicode characters. ... Single, double, and triple quotes all work. ... text = "Python Programming" print(text[0:6]) # Python print(text[:6]) # Python print(text[7:]) # Programming…
Find elsewhere
🌐
CodingNomads
codingnomads.com › string-slicing-in-python
String Slicing in Python
String slicing in Python is when you extract a sub-string from it's parent string. Removing 'age' from 'cottage' is an example of string splicing.
🌐
InterServer
interserver.net › home › python › how to slice strings in python: step-by-step tutorial
How to Slice Strings in Python: Step-by-Step Tutorial - Interserver Tips
April 23, 2026 - The step parameter lets you skip characters in a string. It is written as the third value in the slice: [start:stop:step]. For example, if text = "PythonProgramming", you can get every second character using:
🌐
LearnPython.com
learnpython.com › blog › string-slicing-in-python
String Slicing in Python: A Complete Guide | LearnPython.com
April 15, 2024 - In this article, we’ll learn every aspect of slicing a string in Python. Strings are a sequence of characters; slicing allows us to extract a partial sequence from a string. To slice a string in Python, we use character indexes.
🌐
YouTube
youtube.com › watch
🐍 Python Tutorial #26: String Slicing - YouTube
Learn how to master string slicing in Python with this easy-to-follow tutorial! String slicing allows you to extract parts of strings (substrings) using simp...
Published: June 28, 2025
🌐
YouTube
youtube.com › corey schafer
Python Tutorial: Slicing Lists and Strings - YouTube
In this video we will look at how to slice lists and strings in Python. Slicing allows us to extract certain elements from these lists and strings. This can ...
Published: October 29, 2015
Views: 205K
🌐
Real Python
realpython.com › lessons › string-slicing
String Slicing (Video) – Real Python
Join us and get access to thousands of tutorials and a community of expert Pythonistas. ... In the previous lesson, you saw how you could access individual characters in a string using indexing. In this lesson, you’ll learn how to expand that syntax to extract substrings from a string. This technique is known as string slicing. You’ll practice with the standard syntax, and learn how omitting the first or last index extends the slice.
Published: October 1, 2019
🌐
DigitalOcean
digitalocean.com › community › tutorials › python-slice-string
Python slice string | DigitalOcean
Technical tutorials, Q&A, events — This is an inclusive place where developers can find or lend support and discover new ways to contribute to the community.
🌐
Python.org
discuss.python.org › python help
Advanced slicing rules? - Python Help - Discussions on Python.org
August 14, 2022 - So I’m taking a quiz and the first question asks something that was never written or spoken once in the section on lists as they pertain to slicing… which is absolutely infuriating as I am someone who tries to understand EVERYTHING before moving on: Question 1: What are the values of list_b ...
🌐
YouTube
youtube.com › shorts › LwgnNdxAbyg
String Slicing in Python #Python #NesoAcademy #QuickConcepts - YouTube
In this #shorts, we will learn about string slicing in Python and see how to extract specific parts of a string using index ranges.
Published: June 8, 2025
🌐
CodeHS
codehs.com › tutorial › 13739
Tutorial: Slicing Python Strings | CodeHS
Python Tutorial · python · By Ryan Molyneaux · High School · python · By Ryan Molyneaux · High School · All Products · Coding LMS · Online IDE · CodeHS Pro · Computer Science Curriculum · Certifications · Professional Development · AI Creator ·
🌐
Reddit
reddit.com › r/python › a comprehensive guide to slicing in python
r/Python on Reddit: A Comprehensive Guide to Slicing in Python
February 1, 2022 - 356 votes, 40 comments. Python Slicing is a powerful tool to access sequences. To learn more about the inner mechanics of slices, read this post ;)
🌐
freeCodeCamp
freecodecamp.org › news › slicing-and-indexing-in-python
Slicing and Indexing in Python – Explained with Examples
December 11, 2025 - In these examples, we have used slicing to extract a range of characters from the sentence string. The 4:9 slice means that we are selecting characters starting from index 4 (inclusive) up to index 9 (exclusive), which correspond to the second word "quick".