WEBVTT

0
00:00.320 --> 00:00.980
Hey, guys.

1
00:00.980 --> 00:03.620
Welcome back to 100 Days of Code.

2
00:03.650 --> 00:10.190
Today is Day 4 and we're going to be focusing on randomization in Python,

3
00:10.190 --> 00:12.980
and we're going to be learning about Python lists.

4
00:13.010 --> 00:19.910
Now randomization in any sort of programming language is really, really useful because if we want to

5
00:19.910 --> 00:25.940
create a game, if we want our program to do something different each time, then we need to introduce

6
00:25.940 --> 00:27.830
a little bit of randomness, right?

7
00:27.830 --> 00:32.870
So we're going to be looking at using the random module in order to achieve this,

8
00:32.870 --> 00:39.300
and by the end of today, you will have learned enough to be able to build this Rock Paper Scissors

9
00:39.300 --> 00:39.840
game.

10
00:39.840 --> 00:46.650
So it starts out asking you, the user "Type 0 for rock, 1 for paper, or 2 for scissors."

11
00:46.650 --> 00:49.620
So I'm going to go for 0 for Rock,

12
00:49.620 --> 00:54.300
and it shows me using ASCII art that this is what I chose, Rock.

13
00:54.300 --> 00:59.640
And then the computer chose Scissors, and Rock beat Scissors, so I win.

14
00:59.640 --> 01:02.390
Now you can run this as many times as you want.

15
01:02.390 --> 01:06.530
If I choose Paper and the computer chooses Rock, then I win.

16
01:06.530 --> 01:10.610
If I choose Paper and the computer chooses Paper, then it's a draw.

17
01:10.640 --> 01:15.320
But if I choose Paper and the computer chooses Scissors, then I lose.

18
01:15.320 --> 01:21.050
So this is a pretty simple game, but we're going to get the computer to play this game with us, and

19
01:21.050 --> 01:26.150
we're going to do that by learning about Randomization, Lists, and a whole lot more.

20
01:26.180 --> 01:27.290
I hope you're ready,

21
01:27.290 --> 01:31.700
and once you are, then head over to the next lesson and let's get started.