Program to implement Linear Search in Python

What is Linear Search in Python? Linear search or sequential search is a method for finding a target value within a list. It sequentially checks each element of the list for the target value until a match is found or until all the elements have been searched. Linear search runs in at worst time and … Read more

Program to swap two numbers in Python

Today we will write a program to swap two numbers in Python, we have two ways to do it: Swap using temporary variable. Swap without using temporary variable.   Program to swap two numbers in Python using temporary variable: a = 10 b = 20 print("before swapping\na=", a, " b=", b) temp = a a … Read more