Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
44c3ceb8
Kaydet (Commit)
44c3ceb8
authored
Eki 15, 2010
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#8267: Use sorted() to get a sorted list of dict keys.
üst
a81eae1f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
controlflow.rst
Doc/tutorial/controlflow.rst
+3
-3
datastructures.rst
Doc/tutorial/datastructures.rst
+2
-2
No files found.
Doc/tutorial/controlflow.rst
Dosyayı görüntüle @
44c3ceb8
...
...
@@ -431,9 +431,9 @@ function like this::
print "-- I'm sorry, we're all out of", kind
for arg in arguments: print arg
print "-" * 40
keys =
keywords.keys(
)
keys.sort()
for kw in keys:
print kw, ":", keywords[kw]
keys =
sorted(keywords.keys()
)
for kw in keys:
print kw, ":", keywords[kw]
It could be called like this::
...
...
Doc/tutorial/datastructures.rst
Dosyayı görüntüle @
44c3ceb8
...
...
@@ -481,8 +481,8 @@ using a non-existent key.
The :meth:`keys` method of a dictionary object returns a list of all the keys
used in the dictionary, in arbitrary order (if you want it sorted, just apply
the :
meth:`sort` method to the list of keys). To check whether a single key is
in the
dictionary, use the :keyword:`in` keyword.
the :
func:`sorted` function to it). To check whether a single key is in the
dictionary, use the :keyword:`in` keyword.
Here is a small example using a dictionary::
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment