Python Convert List of Strings/Numbers to Array

When we are working many times we have a requirements where we need to convert list of data from excel or anything to arrays so that we can filter data from DB with in array conditions. Python Programming Step 1: You should have Python installed in your system to run it. Step 2: Create a Directory and Open that directory in VS Code Editor. Step 3: Create 1 file any-name.py. Step 4: Put below codes in created file: with open ( 'list.txt' , 'r' ) as f : content = f . read (). split ( " \n " ) for i in range ( len ( content )): contentLine = content [ i ] if len ( contentLine ) < 10 : print ( contentLine ) content [ i ] = contentLine . rjust ( 10 , '0' ) with open ( 'array.txt' , 'w' ) as f : f . write ( '[" {} "]' . format ( '", "' . join ( content ))) Step 5: Now create 2 files list.txt and array.txt . Step 6: Put some list of any da...