Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to remove some characters from a string in python

import re

inputt = input()
# write the  characters you want to remove in square brackets
line = re.sub('[ie]', '', inputt)
print(line)
Comment

strip characters from a string python

>>> string = 'This is a string, with words!'
>>> string.split()
['This', 'is', 'a', 'string,', 'with', 'words!']
Comment

How to Strip Characters in python

s = 'This is a sentence with unwanted characters.AAAAAAAA'

print('Strip unwanted characters: {}'.format(s.rstrip('A')))

# Output

# Strip unwanted characters: This is a sentence with unwanted characters.
Comment

PREVIOUS NEXT
Code Example
Python :: geopandas plot raster and vector 
Python :: ssd 1306 esp32 python 
Python :: convert set to list python time complexity method 2 
Python :: python print list of keywords 
Python :: operator overloading in python 
Python :: python convert polygone to centroid 
Python :: how to print tic tac toe border on terminal in python 
Python :: dynamic list in python 
Python :: aws ses service python example 
Python :: slice all elements from list 
Python :: Python List insert() add element at designated place 
Python :: calculating expressions with sqrt signs 
Python :: checking time in time range 
Python :: python two list into dictinaray list comprehension 
Python :: Abstract Model inherit from another model django 
Python :: list box tkinter 
Python :: blue ray size 
Python :: django multi column index 
Python :: difference between cut and qcut pandas 
Python :: draw networkx graph using plt.pause 
Python :: strategy forex with python 
Python :: is python not a real programing laguage because lines dont end in ; 
Python :: python numpy read from stdin 
Python :: python 3.10.5 release date 
Python :: enregistremen en pythin picklr 
Python :: how print python 
Python :: plotly two y axis bar chart grouped 
Python :: disable kivy button in kv 
Python :: truncated float python 
Python :: python lister éléments enum 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =