Home > database >  How to create a custom ID on Python
How to create a custom ID on Python

Time:11-01

I need to create an ID during extraction of data (scraping) on Python, so I need to give to each phrase an ID like (A50001) where A is a letter that is the initial letter of site, 5 is a number of stars and 0001 is the number of phrases. How I can do it?

CodePudding user response:

At the end i created like this:

for i in range(1, 100):
  id = sitecode   str(stars)   str(i).zfill(4)
  • Related