Feb-03-2018, 02:00 PM
Thank you for your answer !
For the "bien " and "mal", I corrected the error right after I posted here, I had tried a few more things without results
for TableauPlacement, it is because I "declared" the variable accidentaly ?
i would have never guessed.
So in the code, you are creating a sort of dictionnary, then line 4 it's an abridged version of a "for " condition, but I don't get why there is (u, v) before this,
This line also seems to exclude every "group" of numbers where numbers aren't identical,
then you're counting every pair where numbers are the same,
then I have trouble with that part:
if the "paires" list has some varialbes in it then new a and b lists are equal to every number in "paires"
then for each variable in b, if the variable exists in a, then you add 1 to a counter ?
that means first, you separate the numbers in two groups; those who meet the condition I set and the others,
and then you check with the others if they are just misplaced
wow that's clever, I never thought of separating my array in groups !
For the "bien " and "mal", I corrected the error right after I posted here, I had tried a few more things without results
for TableauPlacement, it is because I "declared" the variable accidentaly ?
i would have never guessed.
So in the code, you are creating a sort of dictionnary, then line 4 it's an abridged version of a "for " condition, but I don't get why there is (u, v) before this,
This line also seems to exclude every "group" of numbers where numbers aren't identical,
then you're counting every pair where numbers are the same,
then I have trouble with that part:
if paires: a, b = zip(*paires) compteurMalPlaces = sum(1 for x in b if x in a) else: compteurMalPlaces = 0what I understand is:
if the "paires" list has some varialbes in it then new a and b lists are equal to every number in "paires"
then for each variable in b, if the variable exists in a, then you add 1 to a counter ?
that means first, you separate the numbers in two groups; those who meet the condition I set and the others,
and then you check with the others if they are just misplaced
wow that's clever, I never thought of separating my array in groups !