## Python Program for Linear Search using For loop

In linear search algorithm we match the element to be searched with the entire list of elements. Therefore its a brute force approach. time complexity: O(n) Linear Search implementation in Python: list_of_elements = [4, 2, 8, 9, 3, 7]x =…

## Python Program to find frequency of Characters in a String

We will find the count of repeating characters in a string using python3. Here we have used dictionary data structure to make a key-value pair for all alphabets and numbers, where the key is the alphabet or number and value…

## Python Program to Convert Decimal to Binary

Using Loop To convert Decimal to binary we check if the number is divisible by 2, if yes then we take a string and append 0 to and and if not then append 1 to it and divide the number…

## Create a Simple FTP Server and Client in Python

FTP stands for File transfer protocol, it’s used to transfer files between server and client. Here we will see how to make a simple FTP server in python and we will do some basic example tasks like listing directories of…

## Python Program to find HCF and LCM

HCF is also called Greatest Common divisor (GCD).the HCF of two or more number is the largest of all the common factors. for example:if we take two numbers, 12 and 18their common divisor are 1,2,3 and 6. therefore 6 being…

## Passing argument from Command-line in Python

Sometimes it’s required to use arguments passed from cli to use in our program. Its very simple to do so.. we just need to use sys module’s argv method. import sysprint(sys.argv)print(sys.argv) Note that using sys.argv will just give program.py, which is in…

## How to Add / Append items to a list in Python

To add items to a list in python is a very general task that you might come across. Here we have an empty list that we are populating with 10 items using the append method. n = 10list = []for…

## Python Program for Binary Search with explanation

Binary search algorithm is used to find a number in a sorted list. so, the pre condition for binary search is that the list should be sorted. If the number is found then its index is returned.This algorithm works on…