Use slicing, rebuilding the string minus the index you want to remove:
newstr = oldstr[:4] + oldstr[5:]
More Related Contents:
- typerror in python while adding value to keys
- change value of list in python
- Searching for IP addresses in a file
- How to make a dict from n’th indices of tuples in list
- Split pandas dataframe based on groupby
- List comprehension with if statement
- Python list doesn’t reflect variable change
- Django, creating a custom 500/404 error page
- Implement touch using Python?
- The difference between sys.stdout.write and print?
- Take the content of a list and append it to another list
- Why do I get “TypeError: ‘str’ object is not callable” with this code?
- What is a cross-platform way to get the home directory?
- Error importing scikit-learn modules
- Building lxml for Python 2.7 on Windows
- Find out how many times a regex matches in a string in Python
- Python – How can I pad a string with spaces from the right and left?
- Python – Twisted, Proxy and modifying content
- tkinter maximum canvas size?
- Save a large file using the Python requests library [duplicate]
- Is it possible to assign the same value to multiple keys in a dict object at once?
- Python library ‘unittest’: Generate multiple tests programmatically [duplicate]
- How to install matplotlib with Python3.2
- How to use a variable as function name in Python
- Capture subprocess output [duplicate]
- How to run stored procedure on SQL server from Spark (Databricks) JDBC python?
- Catching exception in context manager __enter__()
- PyCharm hangs on ‘scanning files to index’ background task
- Beautiful Soup and Table Scraping – lxml vs html parser
- How to install multiple python packages at once using pip