All language subtitles for 13. range()

af Afrikaans
ak Akan
sq Albanian
am Amharic
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
sr Serbian
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

When looping in Python one of the most common tools is this range function that we get out of the box

with Python and you see here that range well is a Range object a special type of object in Python that

returns an object that produces a sequence of integers from start to stop let's explore that are a little

bit more if I print here a range and I say range one hundred and I click Run I get range of zero to

one hundred.

So it looks like a tulpa but it's not.

It's a Range object and it's a special type of object and a range you can give it like this which gives

you a default of zero to whatever you give it which is 100.

Or you can just simply Type 0 one.

And if I click Run it's the same thing but where range becomes really useful and you'll see this in

99 percent of cases in Python is in for loops you see besides topples and lists and sets and dictionaries

and strings.

You can iterate over a range.

So for example if I do for i in range and there's a say item or in our case letters to number in range

and in here I do print no if I run this you'll see that I'll get numbers 1 to 100.

And why is this useful.

Well using a range I was able to loop a hundred times as you can see all the way till 99 because our

count starts at 0 and we're able to loop as many times as I want so I can tell the loop maybe we want

to loop a certain number of times maybe you won't want to loop 10 times where I can tell the loop how

many times to run it's extremely useful maybe here we're performing some action where it says I don't

know email the email list so we want to send 10 emails to an email less for example.

Well again I can just click Run and I sent that email while a bunch of times 10 times.

Another neat trick is that while you might not even need no great we're not really using it in our code

and often while you'll find in python programs is If a programmer doesn't need this variable you just

do an underscore and this is just a variable.

I mean you could use it like this and you'll still get these numbers but it just indicates to other

people that hey I don't really care what this variable is.

I'm just trying to use range so that we can loop over things.

Let's say 10 times now range also comes with a third parameter.

And what that is is they step over.

So if I do too.

And by the way.

Default is one here.

If I do two it jumps from zero to 10 by two which is very very handy.

So what is the range.

Well range creates a special kind of object that we can iterate over OK.

What if I do minus.

Right here.

What if I do minus one.

Well if I run this Hmm that's not going to work because well let me show you why.

If I change this to zero and 10 and I do minus one

it's going to go in the opposite direction but if I did just ten and zero that's not going to work.

If we want to do something in reverse we just have to make sure that we add that minus one or if we

want to step back twice.

Then we click Run.

So you have a lot of options to play with the range.

You can do ascending descending one final thing.

Another place that you might see ranges.

And like I said most of the time they're in for loops but he can also do something interesting like

let's say a range of 10 and then if we wrap this in a list remember a list function allows us to convert

something to a list.

If I run this does you see that let's simplify this so that this range is going to just be too if I

click Run you see that I loop two times and in here I'm going to print first of all I'm going to create

a range and it a rebel object that has 10 items and then I'm going to convert that into a list so you

can see here zero to nine into a list.

So this is a quick way to create a list that ball has integers a neat trick that you'll definitely use

along your program or journey I'll see in the next one.

But by.

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