Professional IronPython


Working with the collections Module



Download 20,35 Mb.
Pdf ko'rish
bet92/453
Sana01.07.2022
Hajmi20,35 Mb.
#723045
1   ...   88   89   90   91   92   93   94   95   ...   453
Working with the collections Module
 

 
73
classes — something not discussed in this chapter. To give you an example of how the objects in 
the containers module work, this section discusses the 
deque
, which has the following methods 
associated with it.
➤➤
append()
: Appends a new item to the right side of the 
deque
.


appendleft()
: Appends a new item to the left side of the 
deque
.


clear()
: Removes all of the elements from the 
deque
and leaves the length at 0.


extend()
: Adds elements to the right side of the 
deque
using an iterable argument, such as
a sequence.


extendleft()
: Adds elements to the left side of the 
deque
using an iterable argument, such 
as a sequence. Adding items to the left side of the 
deque
reverses the order of the elements in 
the iterable argument. For example, if you have a 
list
that contains 
[‘a‘, ‘b‘, ‘c‘]
, this 
method will add them in the order 
[‘c‘, ‘b‘, ‘a‘]
.


pop()
: Removes an item from the right side of the 
deque
and returns it as output to the 
caller. If the 
deque
is empty, this call will raise an 
IndexError
.


popleft()
: Removes an item from the left side of the 
deque
and returns it as output to the 
caller. If the 
deque
is empty, this call will raise an 
IndexError
.


remove()
: Removes the first occurrence of an item, starting from the left side of the 
deque
. If 
the 
deque
doesn’t contain the requested value, this method raises a 
ValueError
.



Download 20,35 Mb.

Do'stlaringiz bilan baham:
1   ...   88   89   90   91   92   93   94   95   ...   453




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish