Bonjour,

J'ai un petit exercice à faire en python, mais j'ignore comment m'y prendre : https://imgur.com/a/OuDrX4j
Voici ce que j'ai déjà commencé à faire:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
from random import*
def echange(tab, i, j):
    if i !=j:
        if 0<=i<=longTab-1 and 0<=j<=longTab-1:
            tab[i], tab[j]=tab[j], tab[i]
        else:
            print("L'un des indices n'appartient pas au tableau..")
tableau = tab
 
 
echange(tab, i, j)