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.
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:
Step 5: Now create 2 files list.txt and array.txt.
Step 6: Put some list of any data either Numbers or Strings in list.txt file.
Step 7: Now go in any-name.py fiile and Run your program via right click in VS Code Editor.
Step 8: Now you can check iin array.txt file your list data will be there in array format.
Thanks for reading this blog, I hope it is helpful for you, if yes please share your feedback in comments sections.
Happy Coding 💻
Comments
Post a Comment