Posts

Showing posts with the label Python

Python Convert List of Strings/Numbers to Array

Image
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...

Top Python Interview Questions

Image
Python is one of the most popular back-end programming language. I hope you must be aware it is the language which is compatible with machine learning that is why it is still too popular for development. Python Logo - Education Funda Python is often used to build websites and software, automate tasks, and conduct data analysis. it is a general purpose language, meaning it can be used to create a variety of different programs and isn't specialised for any specific problems. Let's check the top most commonly asked python interview questions in below video: I hope these python interview questions will help you to crack python interviews easily. Thanks for reading this article guys !!