In [25]:

```
def find_min(L):
n = len(L)
current_min = L[0]
i = 1
while i < n:
if L[i]<current_min:
current_min = L[i]
i = i + 1
return current_min
```

In [32]:

```
L = [15, 3, 17, 22, 9 , 8]
find_min(L)
```

Out[32]:

In [33]:

```
print("Hello")
```

In [34]:

```
x = 17
print(f"Hello, the variable x is equal to {x}")
```

In [35]:

```
print("Hello")
print("World")
```

In [36]:

```
print(7, "Banana", x*5)
```

In [37]:

```
def find_min(L):
n = len(L)
print(f"Length of L is {n}")
current_min = L[0]
print(f"current_min is {current_min}")
i = 1
print("Entering loop")
while i < n:
print(f" Loop with i={i}, L[i]={L[i]}")
if L[i]<current_min:
print(f" Updating current_min to {L[i]}")
current_min = L[i]
i = i + 1
print(f"Value of i is {i}")
print(f"Final output is {current_min}.")
return current_min
```

In [38]:

```
L = [15, 3, 17, 22, 9 , 8]
find_min(L)
```

Out[38]:

Notebook composed of *cells*. Every cell either has *text* (markdown) or *code*. If you press Shift+ENTER on a code cell then you *run* it. The value of the last line is then printed.

In [39]:

```
# What will be printed
i = 5
i = i + 1
i*2
```

Out[39]:

Use `Kernel`

-> `Restart & Clear Output`

to erase all variables and start from the beginning

In [ ]:

```
print("hello") # print("World") This is a comment in the middle of code. It will not run
```

In [ ]:

```
x = 5 # integer
y = 6.5 # floating point (number with fraction)
z = "Boaz" # string
w = False
type(x),type(y),type(z),type(w)
```

In [ ]:

```
type('Hello world!')
```

In [ ]:

```
print('Hello world!')
```

In [ ]:

```
x = 'Hello world!'
print(f"x is a variable of type {type(x)}, the value of x is {x}")
```

In [ ]:

```
type( 5 / 2)
```

In [ ]:

```
type([0, 1, 2])
```

In [ ]:

```
type(5>3)
```

In [ ]:

```
# Here is an example of a NoneType
type(None)
```

In [ ]:

```
x = 1
# Putting a variable at the end of a code block will print it
x
```

In [ ]:

```
# You can find the type of what the variable holds by using type
type(x)
```

In [ ]:

```
# Variables can be reassigned
x = 2
x
```

In [ ]:

```
# The name of a variable is not related to the content at all
two = 4
two
```

In [ ]:

```
# Variables are case-sensitive
X = 4.
print(X,x)
```

In [ ]:

```
# Variables are case-senstive for any part of the variable
Xyz = 3
XYz
```