Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

replace number with string python

    x = re.sub(r"d+", "NUMB", str(x))       #Replaces digits with 'NUMB'
Comment

python string replace letters with numbers

from string import ascii_letters

code = code = "1111702460830000Lu05"
code = "".join([str(ascii_letters.index(c)) if c in ascii_letters else c for c in code])
print(code)
Comment

PREVIOUS NEXT
Code Example
Python :: sqlite3 python parameterized query 
Python :: change python version ubuntu 
Python :: torchvision.transforms 
Python :: how to create obtain any random 3 items of list in python 
Python :: df empty 
Python :: how to sort dictionary in python by lambda 
Python :: how to use print function in python 
Python :: call a Python range() using range(start, stop, step) 
Python :: find how many of each columns value pd 
Python :: python pd.DataFrame.from_records remove header 
Python :: python files 
Python :: code to find the shape of the 2d list in python 
Python :: find the first occurrence of item in a list in python 
Python :: input array of string in python 
Python :: multiple line input python 
Python :: how to do date time formatting with strftime in python 
Python :: how to write a file in python 
Python :: python add list to dictionary in loop 
Python :: how to read tuples inside lists python 
Python :: append record in csv 
Python :: how to convert a byte array to string in python 
Python :: sum of column in 2d array python 
Python :: subprocess print logs 
Python :: upload py file using flask 
Python :: virtual enviroment 
Python :: python size of linked list 
Python :: np.zeros data type not understood 
Python :: python make file path os 
Python :: count values in numpy list python 
Python :: pandas rename column by index 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =