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
afdeca98
Kaydet (Commit)
afdeca98
authored
Agu 08, 2010
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #4570: Clean-up tutorial example
üst
d331ce9e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
datastructures.rst
Doc/tutorial/datastructures.rst
+5
-9
No files found.
Doc/tutorial/datastructures.rst
Dosyayı görüntüle @
afdeca98
...
@@ -377,16 +377,12 @@ empty dictionary, a data structure that we discuss in the next section.
...
@@ -377,16 +377,12 @@ empty dictionary, a data structure that we discuss in the next section.
Here is a brief demonstration::
Here is a brief demonstration::
>>> basket = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana']
>>> basket = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'}
>>> fruit = set(basket) # create a set without duplicates
>>> print(basket) # show that duplicates have been removed
>>> fruit
{'orange', 'bananna', 'pear', 'apple'}
{'orange', 'pear', 'apple', 'banana'}
>>> 'orange' in basket # fast membership testing
>>> fruit = {'orange', 'apple'} # {} syntax is equivalent to [] for lists
>>> fruit
{'orange', 'apple'}
>>> 'orange' in fruit # fast membership testing
True
True
>>> 'crabgrass' in
frui
t
>>> 'crabgrass' in
baske
t
False
False
>>> # Demonstrate set operations on unique letters from two words
>>> # Demonstrate set operations on unique letters from two words
...
...
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