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
e0906d13
Kaydet (Commit)
e0906d13
authored
Agu 31, 2007
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
A few more fixes to the tutorial
üst
7aa02e65
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
controlflow.rst
Doc/tutorial/controlflow.rst
+1
-2
datastructures.rst
Doc/tutorial/datastructures.rst
+5
-5
No files found.
Doc/tutorial/controlflow.rst
Dosyayı görüntüle @
e0906d13
...
...
@@ -436,8 +436,7 @@ 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()
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 @
e0906d13
...
...
@@ -400,12 +400,12 @@ Here is a small example using a dictionary::
>>> tel['irv'] = 4127
>>> tel
{'guido': 4127, 'irv': 4127, 'jack': 4098}
>>>
tel.keys(
)
>>>
list(tel.keys()
)
['guido', 'irv', 'jack']
>>> tel.has_key('guido')
True
>>> 'guido' in tel
True
>>> 'jack' not in tel
False
The :func:`dict` constructor builds dictionaries directly from lists of
key-value pairs stored as tuples. When the pairs form a pattern, list
...
...
@@ -435,10 +435,10 @@ Looping Techniques
==================
When looping through dictionaries, the key and corresponding value can be
retrieved at the same time using the :meth:`ite
rite
ms` method. ::
retrieved at the same time using the :meth:`items` method. ::
>>> knights = {'gallahad': 'the pure', 'robin': 'the brave'}
>>> for k, v in knights.ite
rite
ms():
>>> for k, v in knights.items():
... print(k, v)
...
gallahad the pure
...
...
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