---
# System prepended metadata

title: 'Task on linear search : Chapter 2'
tags: [Kiditech]

---

###### tags: `Kiditech`

# Task on linear search : Chapter 2

(Exercise 1) 
As we talked about before that a linear serch has a complexity of big o(n) since the time is base on the input n

Fill in the following code so that it can performs a linear search basic on the input target 10:

```
list = [2,4,12,4,10,12]

    for i in  list :
        if  x == #fill in here ( answer : 10 )
            print("found it !")
            

How many steps the for loop runs untill it print out "found it!"? (answer : 5 steps)
```
(Exercise 2) 
This function should search for the number that can be divided by 7 in the given list (Fill in the following code so that it can performs that search):

```
list = [100,423,49,58,12]
size = 5
def linear_search(list,size):
    for i in range(0,size):
        if  x == 50
            print("found it !")
            
What will the above function do ?
(a) notthing 
(b) print("found it !") (answer)
(c) program crash

```



