Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

A strange behavieor in passing from list to set

Just a little perturbation

cand = ["A","B","C","D"]
show(cand)
len(cand)

display the natural order A, B, C, D but

Scand=Set(cand)#Attention la majuscule est importante
show(Scand)

change the order to B, D, A, C. This is disturbing since later one ask for arrangement the order is not the naturel one which is highly perturbating in view of the high number of cases.

A strange behavieor in passing from list to set

Just a little perturbation

cand = ["A","B","C","D"]
show(cand)
len(cand)

display the natural order A, B, C, D but

Scand=Set(cand)#Attention la majuscule est importante
show(Scand)

change the order to B, D, A, C. This is disturbing since later one ask for arrangement the order is not the naturel one which is highly perturbating in view of the high number of cases.

A strange behavieor behavior in passing from list to set

Just I find it a little perturbationpuzzling that while the following code:

cand = ["A","B","C","D"]
show(cand)
len(cand)

display displays the natural order A, B, C, D but, this little variation:

Scand=Set(cand)#Attention la Scand = Set(cand)  # La majuscule est importante
show(Scand)

change changes the order to B, D, A, C. .

This is disturbing since when one later one ask asks for arrangementArrangements , the order is not the naturel one natural one, which is highly perturbating in view of perturbing given the high number of cases.