Posts

Showing posts from November, 2021

XII- PYTHON RECORD PROGRAMS

  LIST OF RECORD PROGRAMS Program-1 Aim: To write a python program   to search for a specific element using linear search Source Code: def LINEAR(a,key):     for i in a:         if i==key:             print(key,"found at location",a.index(key))             break     else:         print("Element not found") a=eval(input("Enter the list of elements")) key=eval(input("Enter the key to be searched")) LINEAR(a,key) Sample Output: Program-2 Aim:   To write a python program   to swap first half of the list with second half in a list Source Code: def SWAP(a):     if len(a)%2==0:         j=len(a)//2     els...