All language subtitles for 30. List Methods 3

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

All right.

It feels like it's never going to end.

We have so many methods with less but like I said lists have a lot of methods because you can do a lot

with them.

It seems like a lot right now but trust me these are going to become second nature.

So hang in there.

I have a few more to show you the next one is called sort guess what sort is going to do if I click

Run I get none.

But remember sort sorts the list as you can imagine in place that means and modifies the list.

So if I remove this up to here and then do a sort or do basket and I click Run look at that I get a

sorted list where a D was moved in front of me.

If I add let's say x at the beginning here and I click run it's going to move the X all the way to the

end.

It's going to sort the list in place for me again if I hover over it sees that it's going to not return

anything which is why our print initially didn't work we had to print our basket not whatever this produces

which doesn't produce anything.

But what about this one if we go to built in functions I have something called sorted and if I do sorted

and because it's a function not a method I can do sorted dot or basket.

So around the brackets is just like print if I run this.

All right.

Nothing has changed but what if I remove this and put it in here if I click Run I get a b c d d e x.

What if I comment this out so that we're not sorting it anymore we just have the basket and then we

run this sorted function.

If I run did you see that sorted.

I know it's confusing why do they even have to but sorted produces a new array so if I do print basket

here and I click Run the basket hasn't been modified the basket still remains the same.

It's this one over here that's not sorted sorted.

On the other hand doesn't modify the basket in place.

Instead it creates a new copy of the basket and sorts it.

It's almost as if we're doing this.

We're saying new basket equals basket and then we're going to copy that basket.

Remember list slicing and then we're performing new basket dot sort on this new list so that if I do

new basket and I click Run we get the same thing so you have to be careful of certain actions that perform

an action in place or create a completely new list to begin with.

By the way there's also instead of this a dot copy method that we can use and if I run this again we

get the same thing copy just as the name suggests copy the list for us and returns for us a new list.

All right.

One last one and that is basket dot reverse.

What do you think this does.

Based on the name well if I check out the basket here and click Run is that what you expected.

It reverses the basket in place but notice that it's not like sort it's not sorting it's simply switching

all the indexes into opposite sides.

So D is now index of 0 E is now index of one index of 2 3.

So on and so forth.

So you can see here that it doesn't actually sort it.

Instead while we might want to do is sort first then reverse and if we click Run we have a sorted reversed

basket.

This is a little tricky one that some interviewers might ask.

All right.

Good job getting this far.

We're almost done with lists.

So I'll see you in the next video by.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.