1
00:00:00,510 --> 00:00:05,250
Hello, dear friends, as you remember in our last video, I gave you a little bit of homework.

2
00:00:06,210 --> 00:00:08,190
So in this video, we're going to coat it together.

3
00:00:08,490 --> 00:00:09,150
So let's start.

4
00:00:10,480 --> 00:00:12,630
Now, you remember the logic of the game, right?

5
00:00:13,200 --> 00:00:14,570
The logic is very simple.

6
00:00:14,580 --> 00:00:18,780
Rock, beats, scissors, scissors, beats, paper, paper beats, rock.

7
00:00:19,220 --> 00:00:20,010
Ah, yes.

8
00:00:20,040 --> 00:00:20,910
Now you remember.

9
00:00:21,780 --> 00:00:22,740
So now we can start.

10
00:00:23,280 --> 00:00:27,960
So first, let's import time and random modules import random.

11
00:00:32,090 --> 00:00:33,080
Import time.

12
00:00:37,750 --> 00:00:40,210
So now we need a definition for the user.

13
00:00:41,960 --> 00:00:42,560
Print.

14
00:00:50,550 --> 00:00:53,130
Rock, paper, scissors game.

15
00:00:59,660 --> 00:01:01,490
And please choose one of them.

16
00:01:09,090 --> 00:01:10,320
One rock.

17
00:01:12,250 --> 00:01:13,540
To paper.

18
00:01:15,300 --> 00:01:16,860
Three scissors.

19
00:01:18,330 --> 00:01:19,890
For Exit the game.

20
00:01:25,050 --> 00:01:25,710
Rules.

21
00:01:30,380 --> 00:01:32,750
One rock beats, scissors.

22
00:01:37,850 --> 00:01:40,010
Two scissors beats paper.

23
00:01:47,410 --> 00:01:49,960
Three paper beats rock.

24
00:01:54,980 --> 00:01:55,820
Have fun.

25
00:02:05,400 --> 00:02:10,320
Now let's create a loop while true.

26
00:02:12,750 --> 00:02:21,930
We define a variable named user one and ask for the value be entered by the user, user one equals int

27
00:02:22,320 --> 00:02:22,920
input.

28
00:02:23,340 --> 00:02:27,420
You choose Colan, quote, and devilled princess.

29
00:02:35,090 --> 00:02:37,190
So we create two conditionals.

30
00:02:40,630 --> 00:02:42,910
If user one equals four.

31
00:02:57,500 --> 00:02:58,100
Break.

32
00:03:01,250 --> 00:03:07,040
L.F. user one is greater than equals five print.

33
00:03:14,640 --> 00:03:16,530
Please choose one to four.

34
00:03:29,050 --> 00:03:38,680
Else so we wrote our exit strategy, and if the user chooses out of the defined number, then we're

35
00:03:38,680 --> 00:03:40,210
going to send them a warning.

36
00:03:40,900 --> 00:03:46,600
So now we'll create a dictionary named Game, and its elements are game equals.

37
00:03:49,560 --> 00:03:51,060
One rock.

38
00:03:54,850 --> 00:03:56,500
To paper.

39
00:04:00,590 --> 00:04:02,300
Three scissors.

40
00:04:11,390 --> 00:04:15,200
Now we can create a variable named a I won.

41
00:04:15,950 --> 00:04:26,390
So this variable gets the value from random I one equals random dot rand and one three.

42
00:04:36,290 --> 00:04:41,420
So we define another couple of variables here named A.I. and user.

43
00:04:42,200 --> 00:04:44,930
So these variables get their values from our dictionary.

44
00:04:45,620 --> 00:04:48,620
A.I. equals game dot get.

45
00:04:53,460 --> 00:04:53,940
Won.

46
00:04:57,410 --> 00:05:00,380
User equals game douget, user one.

47
00:05:07,380 --> 00:05:09,990
OK, good, so now we can create our conditionals.

48
00:05:10,890 --> 00:05:12,720
If user equals rock.

49
00:05:17,220 --> 00:05:19,080
And I equal scissors.

50
00:05:25,480 --> 00:05:28,900
Time dot sleep zero, dot one.

51
00:05:30,460 --> 00:05:35,860
So here will use the time module for one second for waiting time.

52
00:05:37,090 --> 00:05:41,740
And then when we complete our game, it'll provide us well, it'll look a whole lot better.

53
00:05:42,070 --> 00:05:44,920
So let's continue rent.

54
00:05:45,550 --> 00:05:46,870
I chose scissors.

55
00:05:47,080 --> 00:05:48,070
You win.

56
00:06:02,430 --> 00:06:04,560
Ayliffe user equals rock.

57
00:06:10,460 --> 00:06:11,000
And.

58
00:06:12,620 --> 00:06:14,310
A.I. equals paper.

59
00:06:20,450 --> 00:06:22,880
Time does not sleep one.

60
00:06:28,640 --> 00:06:29,090
Brent.

61
00:06:33,700 --> 00:06:35,140
I chose paper.

62
00:06:35,530 --> 00:06:36,610
You lose.

63
00:06:44,590 --> 00:06:48,760
Ayliffe user equals paper and III equals scissors.

64
00:07:00,700 --> 00:07:02,440
Time does sleep one.

65
00:07:04,220 --> 00:07:06,770
Print, I chose scissors.

66
00:07:07,220 --> 00:07:08,180
You lose.

67
00:07:18,060 --> 00:07:21,930
L.F. user equals paper and eEye equals rock.

68
00:07:32,580 --> 00:07:34,200
Time does sleep one.

69
00:07:37,630 --> 00:07:39,580
Print, I chose rock.

70
00:07:39,910 --> 00:07:40,900
You win.

71
00:07:48,320 --> 00:07:51,920
Now, user equals scissors and aiai equals paper.

72
00:08:05,870 --> 00:08:07,520
Time does sleep one.

73
00:08:13,050 --> 00:08:15,100
Print, I chose paper.

74
00:08:15,120 --> 00:08:15,990
You win.

75
00:08:29,380 --> 00:08:32,950
L.F. user equals scissors and AAII equals rock.

76
00:08:43,490 --> 00:08:44,720
Time don't sleep one.

77
00:08:49,960 --> 00:08:51,970
Brent, I chose rock.

78
00:08:52,000 --> 00:08:52,930
You lose.

79
00:09:05,740 --> 00:09:06,400
Ls.

80
00:09:09,540 --> 00:09:13,350
Print, draw, dot, please continue.

81
00:09:22,190 --> 00:09:27,050
All right, so we've pretty much calculated every possibility in our game.

82
00:09:28,040 --> 00:09:31,070
Finally, our code is done and we can give it a try.

83
00:09:44,940 --> 00:09:47,100
For example, will choose rock.

84
00:09:52,140 --> 00:09:56,970
And the result is, as you see, or we can choose paper.

85
00:09:57,540 --> 00:09:58,890
And there's another result.

86
00:10:15,600 --> 00:10:21,090
So when we're bored, we can choose to exit the game and then, boom, our game is over.

87
00:10:22,920 --> 00:10:23,880
All right, so that's it.

88
00:10:23,880 --> 00:10:26,850
In this video, we created a rock, paper, scissors game.

89
00:10:27,870 --> 00:10:30,420
We've completed the fundamental things about Python.

90
00:10:30,420 --> 00:10:36,150
So I'm sure you had fun learning something that, well, is the basis of everything else you're going

91
00:10:36,150 --> 00:10:36,480
to do.

92
00:10:37,020 --> 00:10:41,010
So in the next lesson, we're going to start to learn about this thing called data science.

93
00:10:41,760 --> 00:10:43,860
So I really hope see in the next lesson.

94
00:10:44,310 --> 00:10:45,900
Until then, have a nice day.
