- first, **restart the kernel** (in the menubar, select Kernel$\rightarrow$Restart)
- then **run all cells** (in the menubar, select Cell$\rightarrow$Run All).
- make sure you fill in any place that says `YOUR CODE HERE` or "YOUR ANSWER HERE"
- remove `raise NotImplementedError()` to get started with your answer
- bonus points (at the end of this notebook) are optionals
- write your name (and collaborators as a list if any) below:
%% Cell type:code id:7c45a2a5 tags:
``` python
ID=""
COLLABORATORS_ID=[]
```
%% Cell type:markdown id:f14bc602 tags:
---
%% Cell type:markdown id:a4e4fad3 tags:
%% Cell type:markdown id:a4e4fad3 tags:
# Recursion
# Recursion
%% Cell type:markdown id:a8adef9b tags:
%% Cell type:markdown id:a8adef9b tags:
---
---
%% Cell type:markdown id:568202fd tags:
%% Cell type:markdown id:568202fd tags:
### Exercise 0: Find the maximum value in a list (iterative)
### Exercise 0: Find the maximum value in a list (iterative)
Write a function `find_maximum_iterative` that takes a list of numbers as input and returns the maximum value in the list. For this question, you are not allowed to use built-in functions like `max()``.
Write a function `find_maximum_iterative` that takes a list of numbers as input and returns the maximum value in the list. For this question, you are not allowed to use built-in functions like `max()``.
Écrire une fonction \texttt{palindrome} qui indique si un mot peut être lu de manière identique dans les deux sens. Donnez la forme itérative et récursive.
Écrire une fonction \texttt{palindrome} qui indique si un mot peut être lu de manière identique dans les deux sens. Donnez la forme itérative et récursive.
%% Cell type:code id:51bb3d08 tags:
%% Cell type:code id:51bb3d08 tags:
``` python
``` python
def annagram_rec(mot):
def annagram_rec(mot):
### BEGIN SOLUTION
# YOUR CODE HERE
if len(mot) < 2:
raise NotImplementedError()
return True
return mot[0] == mot [len(mot) - 1] and palindrome_rec(mot[1:len(mot)-1])