All language subtitles for 24. Exercise Password Checker

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

Welcome back.

Let's try and do an exercise to tie everything that we've learned up until now.

Together we're going to create a password checker.

Now what we want to do is to create some sort of an input that we're going to ask.

So we're going to use the input function.

And here we're going to ask for a user name.

Then we're going to ask for another input.

It's going to be the password and then at the end with the input we want to print something the lines

of password and then we'll have maybe the actual password in here.

And it will say is another variable here long.

So what we want to do is the password and then maybe the password length so that let's say we printed

our user name JJ and then we give it a password of secret.

Well we should print the password.

Secret is 1 2 3 4 5 6 letters long.

Now obviously we all want to show or display the password maybe for security reasons.

So we want to convert this secret to 1 2 3 4 5 6 2 stars so your task is to convert these two and puts

And you know what.

Let's also do a greeting where we say the user name here.

So we're going to say Hey J.J. your password which will be marked in the star is 6 letters long.

Now one neat trick here that you haven't learned yet and you might want to use here is this.

They can do with strings.

I can go star times make sure that the star is a string.

Multiply it by 10.

And if I print this out

I get 10 stars.

So you may want to use this functionality when we're doing this.

All right.

Positive video.

Give it a go.

If you can remember the goal is to print the username and have the password blocked with how many characters

the password is.

All right.

Pause a video.

If not I'm going to get going with the answer so the first thing we're gonna try and do is I'm going

to create two inputs.

So the first one I'm going to get the user name going to assign into the variable user name.

And it's going to say what is your username.

Then the second one will be the password and the password.

Well we'll say what is your password and although this is a simple example this is something that you

will see with other big Web sites like Instagram or maybe Netflix when you're logging in.

So now that I've stored this information into a variable I can use it.

Right.

I can print and we'll do an F string to make our lives easier.

So I've added the F here.

And what we'll do is this will say user name your password and will add the password.

Here is and then we'll add another variable here which is the password length.

So how are we going to calculate that.

Well let's try something here.

Let's see if I can use the length function and in here.

Do password.

Let's see what happens here what is my username.

Let's go with Andre what is my password.

Let's just type in secret here.

I get Andre your password.

Well I can't speak English properly.

My password secret is 6 while 6 1.

That's right.

6 letters long awesome.

So this is working because with an F string I can create or add a python expression in here using the

length password.

But there's an issue here right.

We don't want to actually print out secret.

We want to print it out in these star form and this is a good discussion topping on readability of your

code.

Now this is a simple example but we can make this code a little bit cleaner.

For example we can break things down so that we'll have password length will be length password.

So we're calculating the length.

So this is going to store 6 or whatever the input of our password is.

And it's nice and descriptive.

It's easy for other developers to understand and then in here I can also have hidden password and this

hidden password will be the password length and we're going to use that star string and multiply it

by the password length.

Let's make this a little bit bigger so that now our code can be understood.

Well in an easier fashion.

So we have the password length so we're gonna say username your password password.

But we want to make sure that it's the hidden password so we'll copy this over here.

So username your password we're gonna print out hit and password is and then we're going to copy password

length.

Now I argue that this reads better because each line is doing something simple.

And then finally we're printing the output.

And although this is a small simple example this idea of readability and making and writing code that

makes sense.

Is an important concept.

So let's see if this works when you click on my username.

Andre.

This time around my password is going to be super secret and look at that Andre.

Your password did it it is eleven letters long.

Good job getting this far.

Hopefully you got that.

I'll see you in the next video.

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