Afrikaans
Akan
Albanian
Amharic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
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 Hey guys, welcome back to 100 Days of Code. 1
Today is day 4, 2
and we're going to be focusing on randomization in Python, 3
and we're going to be learning about Python lists. 4
Now randomization in any sort of programming language is really, 5
really useful because if we want to create a game, 6
if we want a program to do something different each time, 7
then we need to introduce a little bit of randomness, right? 8
So we're going to be looking at using the random module in order to achieve 9
this. And by the end of today, 10
you will have learned enough to be able to build this Rock-paper-scissors game. 11
So it starts out asking you, the user, type 0 for rock, 1 for paper or 2 12
for scissors. So I'm going to go forward with 0 for rock. 13
And it shows me using ASCII art that this is what I chose, rock. 14
And then the computer chose scissors and rock beats scissors. So I win. 15
Now you can run this as many times as you want. 16
If I choose paper and the computer chooses rocks, then I win. 17
If I choose paper and the computer chooses paper than it is a draw. 18
But if I choose paper and the computer chooses scissors, then I lose. 19
So this is a pretty simple game, 20
but we're going to get the computer to play this game with us. 21
And we're going to do that by learning about randomization, lists and a whole lot 22
more. I hope you're ready. 23
And once you are, then head over to the next lesson, and let's get started.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.