Skip to content

Assert qui ne passe pas pour le défi DF8PT [EP24] - 01.2 #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tfontanet opened this issue Apr 12, 2025 · 0 comments
Open

Assert qui ne passe pas pour le défi DF8PT [EP24] - 01.2 #55

tfontanet opened this issue Apr 12, 2025 · 0 comments
Labels
bogue Quelque chose ne tourne pas rond...

Comments

@tfontanet
Copy link

Bonjour,

Pour le défi DF8PT, [EP24] - 01.2, je pense avoir mis la bonne réponse et pourtant je ne passe pas le test 1 !

Voici mon code :

def echange(tab, i, j):
    '''Echange les éléments d'indice i et j dans le tableau tab.'''
    temp = tab[i] 
    tab[i] = tab[j]
    tab[j] = temp 

def tri_selection(tab):
    '''Trie le tableau tab dans l'ordre croissant
    par la méthode du tri par sélection.'''
    N = len(tab)
    for k in range(N): 
        imin = k 
        for i in range(k+1, N): 
            if tab[i] < tab[imin]: 
                imin = i
        echange(tab, imin, k)
@tfontanet tfontanet added the bogue Quelque chose ne tourne pas rond... label Apr 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bogue Quelque chose ne tourne pas rond...
Projects
None yet
Development

No branches or pull requests

1 participant