Write a program to search a element linearly.
INPUT
Enter the elements: 5 2 3 4 10 40
Element to search: 3
OUTPUT
Element is present at index 1
Ele = list(map(int,input("Enter the Elements: ").split(" "))) S = int(input("Element to Search: ")) for i in range(len(Ele)): if Ele[i] == S: print("Element is present at index ",i)
INPUT_1:
Enter the Elements: 5 2 3 4 10 40
Element to Search: 3
OUTPUT:
Element is present at index 2
INPUT_2:
Enter the Elements: 85 96 5 45 200 63 54 21 23
Element to Search: 200
OUTPUT:
Element is present at index 4
INPUT_3:
Enter the Elements: 56 623 20 1000 2000 3000 1011
Element to Search: 1011
OUTPUT:
Element is present at index 6
INPUT_4:
Enter the Elements: 12 25 3
Element to Search: 25
OUTPUT:
Element is present at index 1
ILLUSTRATION
Morae Q!
- OS operating system module using path parameter.
- Find the smallest and largest integers after sorting using bubble sort.
- Find the integer and its number of occurrences.
- Algorithm complexity – Big O Notation with Examples.
- Linear search.
- Map module using series mapping and parallel mapping.
- Mapping and Transposing with Map Module.
- Map Module/built-in Function.
- Linux commands for managing files.
- Program which takes two lists and maps two lists into a dictionary.
- Splitting strings and substituting using regular expressions regex.
- Basics of regular expression Regex.
- Find the square value of the dictionary.
- Check whether the given key is present in the dictionary.
- Matching an expression only in specific places using regular expressions.
- Escaping special characters using regular expressions.
- Check the key.
- Grouping and sub-grouping using regular expressions.
- Generate a Dictionary that Contains Numbers in the Form (x , x*x).
- Algorithm complexity Big-Theta, Big-Omega and Big-O Notations.