Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
0 So we had a script that checks if A is greater than 3 and prints out these operations. 1
If that is true no let me go ahead and use a more real world example. Let's create a variable here called 2
user name and give it a value of an empty string. 3
And here lets check if username is different than the real user name which let's suppose it's py py. 4
Now while that is true we want to ask the user 5
to enter a username. 6
So let's see what's going to happen. 7
Enter user name. 8
We got the prompts here by the input function py. 9
Note we get enter user name again. Pyp maybe, no. Pypy. 10
And so this time we don't get a prompt anymore. 11
The execution of the program ends. 12
So let me explain what's happened here. 13
We declared the empty string to variable user name and then here we check if the value of the username 14
variable is different than pypy. 15
In this case it's different because this is an empty string and this is pypy. 16
Therefore the first iteration will occur which is this one here. 17
So in the first iteration we are asking the user to enter some inputs. 18
This is what happens here in the first iteration. 19
So enter user name was prompted and we entered pi. 20
So pi now is the string that would the assigned to user name and the loop goes through the second iteration. 21
So while the user name is different than pypy which is true in this case because user name for now 22
it's py, the string py, so py is different than pypy, therefore go ahead and execute the body of the while 23
loop again which is this one here. 24
So ask one more time for the user name from the user. 25
So user name the user enters pyp 26
this time, the loop goes through the head through the beginning again and it checks if pyp is different 27
than pypy, that's true, get the user name again. 28
In this case we got pypy, so user name is pypy now. The loop goes again while the user name is different 29
than pypy. 30
In this case that is not true because in this case the user name is equal to pypy, so pypy is different 31
than pypy. 32
No, that's false. 33
So the third iteration this will be equal to false, and that is when the loop ends. 34
So for loops end when their container is exhausted. 35
And while loops ends when the condition is false.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.