Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 2
Problem with dictionary
b = {7, 8, 9} print(b) #Output: {8, 9, 7} Why output is not {7, 8, 9} š¤??
4 Respostas
+ 6
It's not dictionary. It's a set.
And Set does not maintain it's order. so order is unpredictable.
dictionary will have key-value pairs.
+ 3
As Jayakrishnaš®š³ has already stated
b = {8, 7, 9}
print(type(b))
#Output: <class "set">
+ 3
Thank you Jayakrishnaš®š³ & Rik Wittkopp ā¤ļøš
+ 2
Now i understand