so, in my book state that:
dict1 = {'satu': 100, 'dua': 100, 'tiga': 100, 'empat':200}
set1 = set(dict1)
set1
{'tiga', 'dua' 'empat' 'satu'}
and while i try it, the code says:
dict1 = {'satu': 100, 'dua': 100, 'tiga': 100, 'empat':200}
set1 = set(dict1)
set1
{'satu', 'dua' 'empat' 'tiga'}
am i mising something?
My code here[text]
Book Code description here
2
Answers
Order of the elements in set can change. So you can not expect elements to appear in the same order as they are in book. Main point to note is that set has unique elements.
In the documentation it clearly says that:
So the order doesn’t count, the only thing that matters, in your case, is that the elements of the set are the same as the ones displayed in the book.