Try this:
lst = [("aaaa8"),("bb8"),("ccc8"),("dddddd8")]
print([s.strip('8') for s in lst]) # remove the 8 from the string borders
print([s.replace('8', '') for s in lst]) # remove all the 8s
More Related Contents:
- Why does this recursion return 0?
- Does Python IDE have a module which imports math functions such as cos or sin? [closed]
- cartesian product in pandas
- How to print a single backslash?
- Calling Java/Scala function from a task
- Keep other columns when doing groupby
- What does `ValueError: cannot reindex from a duplicate axis` mean?
- How to make program go back to the top of the code instead of closing [duplicate]
- Print a string as hexadecimal bytes
- Conditionally fill column values based on another columns value in pandas
- Why is looping over range() in Python faster than using a while loop?
- How to increment a datetime by one day?
- Why is my Python App Engine app using the Translate API getting an error of ImportError: No module named apiclient.discovery?
- Python: give start and end of week data from a given date
- PIL – draw multiline text on image
- What is the problem with reduce()?
- yet another confusion with multiprocessing error, ‘module’ object has no attribute ‘f’
- Run a python script with arguments
- How to use IFileOperation from ctypes
- How to run different python versions in cmd [duplicate]
- AttributeError: module ‘tensorflow.python.keras.utils.generic_utils’ has no attribute ‘populate_dict_with_module_objects’
- Custom logarithmic axis scaling in matplotlib
- Combine values of same keys in a list of dicts
- Find the index of the k smallest values of a numpy array
- Prevent memory error in itertools.permutation
- Displaying better error message than “No JSON object could be decoded”
- typing.Any vs object?
- Python NoneType object is not callable (beginner) [duplicate]
- Using a class’ __new__ method as a Factory: __init__ gets called twice
- Get legend as a separate picture in Matplotlib