Sep-29-2018, 09:22 AM
I use python 3.7.0
if I type this,
a=set('12345')
and then type a,
outcome likes {3,1,2,4,5} or {4,1,2,3,5} or {1,3,4,2,5} in random sequence.
but I found this one.
if I type this
a=set(i for i in range (1,12) if i%2==0)
and then type a,
outcome is always {2,4,6,8,10} why ALWAYS outcome like this?
and one more weird thing,
when I type this
a=set(i for i in range (1,10) if i%2==0)
and then type a,
outcome is always {8,2,4,6} Whatttttttttttttttt
I think print of set-type is always random. is it wrong??
if I type this,
a=set('12345')
and then type a,
outcome likes {3,1,2,4,5} or {4,1,2,3,5} or {1,3,4,2,5} in random sequence.
but I found this one.
if I type this
a=set(i for i in range (1,12) if i%2==0)
and then type a,
outcome is always {2,4,6,8,10} why ALWAYS outcome like this?
and one more weird thing,
when I type this
a=set(i for i in range (1,10) if i%2==0)
and then type a,
outcome is always {8,2,4,6} Whatttttttttttttttt
I think print of set-type is always random. is it wrong??