---
# System prepended metadata

title: Python TP Gr.2 Eq.4

---

# Python TP Gr.2 Eq.4

##### You can put your code in the section below with in the three ` ```python= ``` `

```python=
a = 3
b = 6
# this is called pythonic code style
a, b = b, a
# a = 6, b = 3
```



```python=
a, *rest = [1, 2, 3]
# a = 1, rest = [2, 3]
a, *middle, c = [1, 2, 3, 4]
# a = 1, middle = [2, 3], c = 4
```

x=input()
liste = [2,5,1,9,11]
list(liste) #renvoie [2, 5, 1, 9, 11]
tuple(liste) #envoie (2, 5, 1, 9, 11)
str(liste) #renvoie '[2, 5, 1, 9, 11]'
dict((x,0)for x in liste)  #renvoie {2: 0, 5: 0, 1: 0, 9: 0, 11: 0}
dict((x, i)for i, x in enumerate(liste)) #renvoie {2: 0, 5: 1, 1: 2, 9: 3, 11: 4}
set(liste) #renvoie {1, 2, 5, 9, 11}
set([100,] + liste) #renvoie {1, 2, 100, 5, 9, 11}

