﻿1
00:00:00,000 --> 00:00:04,319
well our net and welcome i learned to
program tutorial in this tutorial series

2
00:00:04,319 --> 00:00:07,680
is going to be multi-part series I'm
going to teach you how to program

3
00:00:07,680 --> 00:00:09,599
through problem solving

4
00:00:09,599 --> 00:00:13,200
I'm basically going to show you how to
do a couple different things using

5
00:00:13,200 --> 00:00:16,169
Python that's the language i'm going to
use and then I'm going to ask you a

6
00:00:16,170 --> 00:00:20,160
question ask you to solve it and then
i'm going to show you how I solved a lot

7
00:00:20,160 --> 00:00:23,730
of people get confused about programming
but programming basically involves

8
00:00:23,730 --> 00:00:27,300
listing all the things that must happen
to solve a problem

9
00:00:27,990 --> 00:00:32,098
and whenever you're writing a program
you have to first determine step by step

10
00:00:32,098 --> 00:00:36,510
what needs to happen and then you need
to convert those steps into the language

11
00:00:36,510 --> 00:00:41,550
being Python in this situation based off
of many requests i received i'm going to

12
00:00:41,550 --> 00:00:47,129
use pycharm in this tutorial series and
at the end of this tutorial series at

13
00:00:47,129 --> 00:00:51,629
the end of this video i show you how to
install pycharm and in the description

14
00:00:51,629 --> 00:00:56,519
underneath the video you can just click
on that and jump directly to that part

15
00:00:56,520 --> 00:01:00,270
and watch how to install it if you'd
like to use pycharm or you could use

16
00:01:00,270 --> 00:01:04,439
whatever different platform you'd like
to use the program python were

17
00:01:04,438 --> 00:01:08,729
specifically going to use Python 3 in
this situation and also in the

18
00:01:08,729 --> 00:01:12,390
description there is both the cheat
sheet as well as a transcript of the

19
00:01:12,390 --> 00:01:17,369
entire tutorial and enough talking let's
get into it now this whole tutorial

20
00:01:17,369 --> 00:01:20,790
series is going to be basically code
writing it isn't going to be a whole

21
00:01:20,790 --> 00:01:25,259
bunch of frames that you just look at
and read so this is basically going to

22
00:01:25,259 --> 00:01:27,900
be the only one we're going to look at
and basically what we're going to talk

23
00:01:27,900 --> 00:01:32,880
about here is what every program
language is going to allow you to do

24
00:01:32,880 --> 00:01:37,140
each language is going to have the
ability to accept input and store it in

25
00:01:37,140 --> 00:01:42,180
many ways also the ability to output
information to the screen or files or

26
00:01:42,180 --> 00:01:43,590
other different places

27
00:01:43,590 --> 00:01:47,850
also the ability to conditionally do one
thing or another thing based off of

28
00:01:47,850 --> 00:01:49,259
different conditions

29
00:01:49,259 --> 00:01:53,430
they also allow you to do something
multiple different times

30
00:01:53,430 --> 00:01:57,930
they also allow you to make mathematical
calculations and they provide the

31
00:01:57,930 --> 00:02:02,250
ability to change data and if it's an
object-oriented programming language

32
00:02:02,250 --> 00:02:05,600
like Python it's going to allow you to
model real

33
00:02:05,600 --> 00:02:10,818
world objects using code and that is a
short list but for the most part that

34
00:02:10,818 --> 00:02:14,510
covers what every programming language
is going to allow you to do so

35
00:02:14,510 --> 00:02:17,660
it's not that complicated and now we're
going to jump over and we're going to

36
00:02:17,660 --> 00:02:18,920
start writing some code

37
00:02:18,920 --> 00:02:22,730
ok so to start a new project inside a
pie chart we're just going to come down

38
00:02:22,730 --> 00:02:26,359
here and this is on Macintosh i'll show
you windows and second click on create

39
00:02:26,360 --> 00:02:30,530
new project and then we can go and save
this wherever location

40
00:02:30,530 --> 00:02:34,700
untitled we're going to click on this
and I'm going to find a location

41
00:02:35,300 --> 00:02:39,830
this is perfectly fine click on OK then
you want to make sure that you pick the

42
00:02:39,830 --> 00:02:44,209
version 3.5 point 1 the new version of
python you install click on that click

43
00:02:44,209 --> 00:02:47,870
on create it's going to say it's not
empty that a might give you a different

44
00:02:47,870 --> 00:02:52,040
piece of information and then to create
a new file you're going to go file

45
00:02:52,750 --> 00:02:58,030
new and they're going to go file and
then we're going to call this Python

46
00:02:58,030 --> 00:03:03,430
touch and the extension for python files
is . py click on people there

47
00:03:03,430 --> 00:03:07,000
click on OK and there you are for mac
and for windows are going to do pretty

48
00:03:07,000 --> 00:03:08,380
much exactly the same thing

49
00:03:08,380 --> 00:03:11,980
create a new project you're going to
find a location that's perfectly fine

50
00:03:12,550 --> 00:03:16,030
we're going to say okay you're going to
make sure that you have version 3.5

51
00:03:16,030 --> 00:03:21,910
point one of Python click on create -
it's not empty quickly yes and then come

52
00:03:21,910 --> 00:03:26,890
over here and click on file and new and
new file and I'm going to call this

53
00:03:26,890 --> 00:03:29,350
Python touch as well you can call it
whatever you want

54
00:03:29,350 --> 00:03:33,280
course . py ok and now you're ready to
program

55
00:03:33,820 --> 00:03:38,530
alright so here we are inside of pie
charm and once again in the description

56
00:03:38,530 --> 00:03:41,650
click on that it's going to jump into
the end of the video and it will show

57
00:03:41,650 --> 00:03:44,890
you how to install it on mac or windows
either one of them

58
00:03:44,890 --> 00:03:49,119
so basically what we're going to do here
is we are going to want to ask the user

59
00:03:49,120 --> 00:03:54,400
of our program to enter in their name
and then we're going to say hello and

60
00:03:54,400 --> 00:03:58,870
follow that up with whatever their name
is no remember i said previously that we

61
00:03:58,870 --> 00:04:02,680
need to list all the things we want to
happen to solve our problem

62
00:04:02,680 --> 00:04:07,209
so what we want to do here is we want to
first off if you put a hash symbol right

63
00:04:07,209 --> 00:04:07,630
there

64
00:04:07,630 --> 00:04:11,350
that's a comment that means the Python
interpreter is going to disregard

65
00:04:11,350 --> 00:04:16,180
everything you put there and it is very
good to comment your code if you want to

66
00:04:16,180 --> 00:04:20,829
have a multi-line comment just put those
three little quotes like that and look

67
00:04:20,829 --> 00:04:23,740
at that now you have a multi-line
comment

68
00:04:23,740 --> 00:04:28,180
ok pretty cool stuff so you can remember
that for later pretty easy to remember

69
00:04:28,180 --> 00:04:33,729
what we want to do here is we want to
start right not exactly what we want to

70
00:04:33,729 --> 00:04:43,270
happen so we're going to say ask the
user to input their name and assign it

71
00:04:43,270 --> 00:04:46,889
to a variable name

72
00:04:46,889 --> 00:04:51,629
named name and we have to have a place
to store things and variables allow us

73
00:04:51,629 --> 00:04:56,729
to say this is a name and it's going to
be associated with a certain piece of

74
00:04:56,729 --> 00:04:57,449
data

75
00:04:57,449 --> 00:05:02,460
so how do we convert that into python
well we want to create a variable name

76
00:05:02,460 --> 00:05:03,029
name

77
00:05:03,029 --> 00:05:06,689
and there it is and then we want to
accept input from the user

78
00:05:07,229 --> 00:05:11,430
so we just type in input we want to put
a message on the screen so the user can

79
00:05:11,430 --> 00:05:16,770
see it and that message is going to be
what is your name and you don't have to

80
00:05:16,770 --> 00:05:19,979
put anything else there and you can skip
down to the next line

81
00:05:19,979 --> 00:05:23,400
so what we want to do now that we have
that all set up

82
00:05:23,400 --> 00:05:27,388
well we simply want to print out

83
00:05:27,389 --> 00:05:31,080
hello followed by the name

84
00:05:31,080 --> 00:05:35,430
they entered ok that's it's pretty
simple program and how do we print

85
00:05:35,430 --> 00:05:36,960
things out on the screen

86
00:05:36,960 --> 00:05:40,620
well we just call for print because we
want to print out on the screen and then

87
00:05:40,620 --> 00:05:44,009
we type in exactly what we want to have
here so we're going to have hello

88
00:05:44,520 --> 00:05:48,508
and we're going to separate all of the
different things are going to print out

89
00:05:48,509 --> 00:05:49,319
to the screen

90
00:05:49,319 --> 00:05:53,520
so here is going to be a string which is
just a bunch of characters and here

91
00:05:53,520 --> 00:05:59,008
we're going to say that we want the data
that is stored inside of name to also be

92
00:05:59,009 --> 00:06:03,509
printed out on the screen now i'm going
to run this and you can see right here

93
00:06:03,509 --> 00:06:06,689
at the bottom of the screen it says what
is your name

94
00:06:06,689 --> 00:06:10,229
and i am going to type in my name look
at this

95
00:06:10,229 --> 00:06:14,370
I made a mistake already i'm supposed to
be an expert let's go and put a space

96
00:06:14,370 --> 00:06:17,250
inside of there and let's rerun this

97
00:06:17,250 --> 00:06:22,110
so we run it what is your name and i'm
going to type in Derek and hit enter and

98
00:06:22,110 --> 00:06:24,089
it's going to say hello Derek

99
00:06:24,089 --> 00:06:29,430
just like that so pretty simple little
program and we're going to get much more

100
00:06:29,430 --> 00:06:33,899
complicated as these go on and of course
i'm going to start asking you questions

101
00:06:33,899 --> 00:06:38,219
and then I'm going to pause the video
you're going to write the code and then

102
00:06:38,219 --> 00:06:42,449
you are going to then be able to just
learn through problem solving

103
00:06:42,449 --> 00:06:46,949
so another thing just before we move on
is variable names can either start with

104
00:06:46,949 --> 00:06:50,070
a letter any letter you'd like or
underscore

105
00:06:50,070 --> 00:06:54,780
and you can of course come in here and
separate these you could say something

106
00:06:54,780 --> 00:07:01,140
like the name like that and after the
first letter inside of here

107
00:07:01,140 --> 00:07:06,659
you can also come in and also use
numbers so that is the ways that you

108
00:07:06,660 --> 00:07:10,560
would create variable names which are
just storage cells and it's also very

109
00:07:10,560 --> 00:07:16,290
important that those variable names are
not any of these words right here

110
00:07:16,290 --> 00:07:22,140
so you can't use and dl from dada not
anything you really need to worry about

111
00:07:22,140 --> 00:07:27,330
and as you learn more about Python you
are going to just know that these are

112
00:07:27,330 --> 00:07:30,390
commands used in Python and you cannot
use them

113
00:07:30,390 --> 00:07:34,169
who's going to name anything lambda
anyway or variable named for these are

114
00:07:34,170 --> 00:07:38,220
all pretty weird things and by no means
should you go in and try to memorize

115
00:07:38,220 --> 00:07:42,630
that ok so now let's do something a
little bit more complicated basically

116
00:07:42,630 --> 00:07:48,719
what we're going to do is allow your
users to do math on two values that they

117
00:07:48,720 --> 00:07:49,320
enter

118
00:07:49,320 --> 00:07:53,040
so what are we going to do we're going
to type out exactly what needs to be

119
00:07:53,040 --> 00:07:58,710
done so we're going to say ask the user
and you should do this for every program

120
00:07:58,710 --> 00:08:02,370
I even do it today with very very big
programs so we're going to say ask the

121
00:08:02,370 --> 00:08:11,310
user to input two values and store them
in variables that are going to have the

122
00:08:11,310 --> 00:08:16,200
name of num1 and num2 what we're going
to then do

123
00:08:16,200 --> 00:08:19,920
that's going to be a little bit
different is whenever these pieces of

124
00:08:19,920 --> 00:08:24,360
data come and they are all considered
just random bits of characters or

125
00:08:24,360 --> 00:08:25,470
strings

126
00:08:25,470 --> 00:08:31,110
so what we're going to have to do is
figure out a way to convert the strings

127
00:08:31,110 --> 00:08:38,580
that the users enter in into regular
numbers and these regular numbers are

128
00:08:38,580 --> 00:08:42,870
not going to have decimal places and in
situations which you have a variable

129
00:08:42,870 --> 00:08:46,830
that doesn't have a decimal place it is
known as an integer

130
00:08:46,830 --> 00:08:52,290
ok so we received the pieces of data
that we want the two numbers that we

131
00:08:52,290 --> 00:08:54,060
want to some together

132
00:08:54,060 --> 00:08:55,219
so what we need to do

133
00:08:55,220 --> 00:09:05,180
we need to add the values entered and
store in a variable named some a pretty

134
00:09:05,180 --> 00:09:08,180
simple stuff and then what do we need to
do

135
00:09:08,180 --> 00:09:12,500
well let's go into a little bit more
math let's also say that we want to

136
00:09:12,500 --> 00:09:21,649
subtract values and store it in a
variable that is known as difference and

137
00:09:21,649 --> 00:09:22,910
let's do some more

138
00:09:22,910 --> 00:09:32,420
we will multiply the values and store it
in a variable that is named product and

139
00:09:32,420 --> 00:09:40,279
finally we will divide the values and
store in another variable that's going

140
00:09:40,279 --> 00:09:44,779
to be called quotient and what the heck
let's do another one and then we also

141
00:09:44,779 --> 00:09:52,610
want to use a funky little tool that we
have called modulus on the values to

142
00:09:52,610 --> 00:09:58,970
find the remainder and guess what we're
going to call that remainder and let's

143
00:09:58,970 --> 00:09:59,839
do another one

144
00:09:59,839 --> 00:10:05,930
we're going to print the results on the
screen for the user because it wouldn't

145
00:10:05,930 --> 00:10:09,859
be useful if it didn't do that and I
guess that's basically it

146
00:10:09,860 --> 00:10:13,069
so now after we created all the steps
that we need to do

147
00:10:13,069 --> 00:10:16,099
we're going to come in here and fill it
in with python code

148
00:10:16,100 --> 00:10:21,470
so how do we receive two pieces of data
inside of Python pretty simple we used

149
00:10:21,470 --> 00:10:28,189
input before so of course we're going to
have input is going to be used and we

150
00:10:28,189 --> 00:10:29,839
are going to again

151
00:10:29,839 --> 00:10:35,720
type in the men the message we want so
we're going to say enter two numbers and

152
00:10:35,720 --> 00:10:41,180
then we are going to receive two numbers
and there's a fancy little function

153
00:10:41,180 --> 00:10:46,008
inside of function inside of Python
called split what it's going to do is

154
00:10:46,009 --> 00:10:49,309
it's going to you're going to enter not
two numbers let's say there are two and

155
00:10:49,309 --> 00:10:49,850
four

156
00:10:49,850 --> 00:10:53,959
well we have to decide how are we going
to take these two numbers that they

157
00:10:53,959 --> 00:10:59,300
enter enter well what split does is it
says if there is a space or white space

158
00:10:59,300 --> 00:11:03,630
between these numbers we are going to
separate those values that way and then

159
00:11:03,630 --> 00:11:09,060
and we're going to have to assign them
to variables and if you want to have two

160
00:11:09,060 --> 00:11:12,959
variables one is called mom one and the
other one is called them to you just put

161
00:11:12,960 --> 00:11:16,440
the two of them in there just like you
did with the one previously and there

162
00:11:16,440 --> 00:11:20,040
you go now you're going to be able to
receive two pieces of data instead of

163
00:11:20,040 --> 00:11:22,380
just one so pretty cool stuff

164
00:11:22,380 --> 00:11:26,640
we then have to convert our strings also
that Python knows that we're working

165
00:11:26,640 --> 00:11:29,370
with integers and that's pretty easy to
do

166
00:11:29,370 --> 00:11:33,900
we just say that we want to store inside
of the number one variable an integer

167
00:11:33,900 --> 00:11:40,740
version of num1 and then we can go and
do exactly the same thing for num -

168
00:11:40,740 --> 00:11:46,140
so there's num - and there's nothing to
sew it's just converting a string into

169
00:11:46,140 --> 00:11:46,890
an integer

170
00:11:46,890 --> 00:11:51,420
that's all it's doing now we need to add
these values and store them into a

171
00:11:51,420 --> 00:11:54,180
variable called some pretty easy to do

172
00:11:54,180 --> 00:11:59,189
we just say nom 1 plus num2 pretty much
exactly the way that you would think it

173
00:11:59,190 --> 00:12:00,030
would work

174
00:12:00,030 --> 00:12:03,600
so we're going to take the value in here
added to the value in here and store it

175
00:12:03,600 --> 00:12:05,640
inside of this guy right here

176
00:12:05,640 --> 00:12:09,330
let's go and do the same thing with
subtraction and all we do is change that

177
00:12:09,330 --> 00:12:11,670
guy right there when we want to multiply

178
00:12:11,670 --> 00:12:14,910
we're just going to go and put a star
inside of there like that

179
00:12:14,910 --> 00:12:19,050
if we want to divide we're going to
change this to divide and be modulus

180
00:12:19,050 --> 00:12:21,540
which is going to give us the remainder

181
00:12:21,540 --> 00:12:25,589
we're just going to come in here and
we're going to put it like that but this

182
00:12:25,590 --> 00:12:29,820
is some we can't use these variables
these variable names because it would

183
00:12:29,820 --> 00:12:34,410
overwrite the value stored in some each
time and we already know that we want to

184
00:12:34,410 --> 00:12:39,630
store those in variables called
difference in this situation and product

185
00:12:39,630 --> 00:12:44,310
in the situation because we wrote all
this stuff out and quotient in this

186
00:12:44,310 --> 00:12:49,560
situation right here and then finally
remainder like we have right here

187
00:12:49,560 --> 00:12:53,579
but now we want to print our results and
we want to print them in a format let's

188
00:12:53,580 --> 00:12:57,630
say that they enter five claw and for
inside of here

189
00:12:57,630 --> 00:13:04,110
what we want to do is we want to go and
print it out on the screen 5 plus 4 is

190
00:13:04,110 --> 00:13:05,670
equal to 9

191
00:13:05,670 --> 00:13:08,750
so how are we going to do that with our
print statement

192
00:13:08,750 --> 00:13:13,070
we can't do it in its current format so
what we're going to do instead is we

193
00:13:13,070 --> 00:13:17,990
need to format our output onto the
screen whenever it's printed

194
00:13:17,990 --> 00:13:21,560
we're going to still use print just like
we did before and what we're going to do

195
00:13:21,560 --> 00:13:27,500
at the end of this is like I said we
need to format our output and we need to

196
00:13:27,500 --> 00:13:31,640
say num1 and num2 and then some

197
00:13:31,640 --> 00:13:35,840
but how inside of this little string
inside of here remember if it's in

198
00:13:35,840 --> 00:13:38,870
quotes it's a string we're just building
it ourselves

199
00:13:38,870 --> 00:13:43,130
how are we going to say we're number 1
num2 and some go - well we just come in

200
00:13:43,130 --> 00:13:47,240
here and throw in some curly brackets
and throw in some more curly brackets

201
00:13:47,240 --> 00:13:51,710
and then throw in one more curly bracket
and what this is going to do for us is

202
00:13:51,710 --> 00:13:55,550
it's going to take this number one right
over the value for it is and throw it

203
00:13:55,550 --> 00:13:56,390
right there

204
00:13:56,390 --> 00:14:00,530
num - is going to be thrown in right
there and then some is going to be

205
00:14:00,530 --> 00:14:01,760
thrown in right there

206
00:14:01,760 --> 00:14:06,800
so that is how we can form at all of our
data we can just come in here and do

207
00:14:06,800 --> 00:14:07,939
this couple times

208
00:14:07,939 --> 00:14:12,649
x and then we will just change that to
subtraction we can come up here make

209
00:14:12,649 --> 00:14:15,589
sure that we have our variable name is
exactly the same

210
00:14:15,589 --> 00:14:20,659
and also if I didn't mention this
previously difference is completely

211
00:14:20,659 --> 00:14:25,819
different from difference is this case
sensitive so make sure you use exactly

212
00:14:25,819 --> 00:14:31,429
the same variable name and also we come
up here and get product bring this down

213
00:14:31,429 --> 00:14:32,029
here

214
00:14:32,029 --> 00:14:37,309
change this to multiply and throw in
products right there and quotient

215
00:14:37,309 --> 00:14:39,919
whenever your very first starting off
with programming

216
00:14:39,919 --> 00:14:43,339
it is a good idea to just come in here
and copy and paste make sure these

217
00:14:43,339 --> 00:14:47,689
variable names are exactly the same
that's not a problem and then remainder

218
00:14:47,689 --> 00:14:54,498
for the modulus and let's change that
this and remainder and if we save that

219
00:14:54,499 --> 00:14:59,239
and then we run it we come down here and
her two numbers and the two numbers were

220
00:14:59,239 --> 00:15:04,189
going to enter our five-member the space
and a four hit enter and is going to go

221
00:15:04,189 --> 00:15:08,299
and output our data exactly the way that
we think that it should

222
00:15:08,299 --> 00:15:11,358
let's just move this up here so you can
see everything all at once

223
00:15:11,359 --> 00:15:16,039
so there you go that is how we go about
receiving all of that information and

224
00:15:16,039 --> 00:15:20,520
then providing the proper output and now
based off of n

225
00:15:20,520 --> 00:15:25,410
everything you learned right there I
think you are ready to solve your first

226
00:15:25,410 --> 00:15:26,819
python program

227
00:15:26,820 --> 00:15:29,910
so what we want to do here is our
problem

228
00:15:29,910 --> 00:15:35,189
that's going to throw in a comment our
problem is going to allow the user to

229
00:15:35,190 --> 00:15:37,440
enter miles

230
00:15:37,440 --> 00:15:46,500
so say receive miles and convert two
kilometers and then some information

231
00:15:46,500 --> 00:15:53,610
that we need to know is that kilometers
is going to be equal to miles

232
00:15:53,610 --> 00:16:01,140
x 1.6 09 3 4 and the output are
basically the program the way we want it

233
00:16:01,140 --> 00:16:07,020
to look here is the message is going to
be printed out on screen is enter miles

234
00:16:07,020 --> 00:16:11,730
they are then going to be able to enter
the number five and then we are going to

235
00:16:11,730 --> 00:16:13,170
output on the screen

236
00:16:13,170 --> 00:16:19,260
five miles equals and something like
eight point of for something kilometers

237
00:16:19,260 --> 00:16:20,490
whatever that is

238
00:16:20,490 --> 00:16:24,690
so there you go so like its a cheat
sheet description you can refer to that

239
00:16:24,690 --> 00:16:27,690
so that you don't have to jump back and
forth through the video or you could

240
00:16:27,690 --> 00:16:31,200
rewind the video or whatever you want to
do but basically what i want you to be

241
00:16:31,200 --> 00:16:36,270
able to do here is to print out this
string allow them to enter a number and

242
00:16:36,270 --> 00:16:40,949
then output this information and which
is you do right now is pause your screen

243
00:16:40,950 --> 00:16:45,690
go write the code and then come back and
i'll show you the results or my solution

244
00:16:45,690 --> 00:16:46,980
for this program

245
00:16:46,980 --> 00:16:51,630
alright so here we are back again and
now i'm going to walk step by step

246
00:16:51,630 --> 00:16:53,580
through exactly how to solve this

247
00:16:53,580 --> 00:16:56,690
so I'm going to say something like ask
the

248
00:16:56,690 --> 00:17:00,440
user to input miles

249
00:17:00,440 --> 00:17:08,540
hopefully you went and typed all this
out and assign it to the miles variable

250
00:17:08,540 --> 00:17:10,819
and we also we're going to need to do
here

251
00:17:10,819 --> 00:17:17,839
well remember we need to convert from
string to integer and yes there's other

252
00:17:17,839 --> 00:17:23,810
ways to do that on logging into that
later on we then also want to perform a

253
00:17:23,810 --> 00:17:34,340
calculation by mall to applying 1.6 09 3
4 times miles and save that in a

254
00:17:34,340 --> 00:17:41,810
variable called kilometers and then we
want to print results using format

255
00:17:41,810 --> 00:17:45,710
yes I use kind of bad english one from
typing a comment sometimes sorry about

256
00:17:45,710 --> 00:17:47,000
that hope that doesn't bother

257
00:17:47,000 --> 00:17:50,990
alright so what we're going to do right
here well we're going to create a

258
00:17:50,990 --> 00:17:56,510
variable called miles and we want to
receive input and we want to print out a

259
00:17:56,510 --> 00:18:02,750
message here that says enter miles and
we'll throw a little space inside of

260
00:18:02,750 --> 00:18:09,980
there then we want to convert miles into
an integer version of the variable

261
00:18:09,980 --> 00:18:15,140
called miles weekend and then need to
perform our calculations

262
00:18:15,140 --> 00:18:18,800
this is going to be kilometers is equal
to miles

263
00:18:18,800 --> 00:18:26,659
x 1.6 09 3 4 and then we need to print
our results using format i showed you

264
00:18:26,660 --> 00:18:30,290
what i wanted you to print out before
and we're going to throw in our curly

265
00:18:30,290 --> 00:18:35,270
brackets right there and we're going to
say miles equals and then throw in with

266
00:18:35,270 --> 00:18:35,570
the

267
00:18:35,570 --> 00:18:40,610
kilometers come outside of that double
quote and then we're going to say format

268
00:18:40,610 --> 00:18:44,149
and then what we want to go inside of
there is going to be whatever is stored

269
00:18:44,150 --> 00:18:48,440
in the variable called miles and
whatever is stored in the variable

270
00:18:48,440 --> 00:18:50,870
called kilometers

271
00:18:50,870 --> 00:18:54,560
we're going to save that and then we're
going to run it and it's going to say

272
00:18:54,560 --> 00:18:57,919
enter miles in our example i typed in
five

273
00:18:57,920 --> 00:19:03,110
and here we can see five miles equals
eight point 0 for 6 7 kilometers

274
00:19:03,110 --> 00:19:08,060
so there you go hopefully did good with
your first example if you didn't

275
00:19:08,060 --> 00:19:12,200
that is not a problem at all you're
going to have a lot of chances to do all

276
00:19:12,200 --> 00:19:14,540
of this right and i guess said

277
00:19:14,540 --> 00:19:18,470
making mistakes is the best way to be
able to learn how to program that's all

278
00:19:18,470 --> 00:19:21,680
programming is now let's do something a
little bit more interesting

279
00:19:21,680 --> 00:19:26,000
let's say we want to create a calculator
so we want to be able to receive two

280
00:19:26,000 --> 00:19:31,460
numbers separated by the operator of
choice and then we want to show a result

281
00:19:31,460 --> 00:19:37,730
so for example I want to output on the
screen enter calculation and then I want

282
00:19:37,730 --> 00:19:42,020
them to be able to enter something like
5 times 6 and then it's going to output

283
00:19:42,020 --> 00:19:46,670
the proper information there after I
then we're going to print out on the

284
00:19:46,670 --> 00:19:50,750
screen 5 times 6 is equal to 30

285
00:19:50,750 --> 00:19:53,900
okay but we're going to allow them to
use addition subtraction multiplication

286
00:19:53,900 --> 00:19:55,820
or division

287
00:19:55,820 --> 00:19:59,450
whenever they are providing that
information to us

288
00:19:59,450 --> 00:20:03,590
so here we are let's comment that out so
it doesn't mess anything up and then

289
00:20:03,590 --> 00:20:10,220
we'll walk through exactly what we need
to do here so we want to store the user

290
00:20:10,220 --> 00:20:19,880
inputs of two numbers and the operator
of choice and then what we want to do

291
00:20:19,880 --> 00:20:28,640
well we need to convert the strings into
integers just the numbers though we're

292
00:20:28,640 --> 00:20:32,030
not going to convert the operator that
are going to be using then we're going

293
00:20:32,030 --> 00:20:35,629
to use a fancy tool remember i said
before every programming language is

294
00:20:35,630 --> 00:20:38,620
going to provide the ability to perform

295
00:20:38,620 --> 00:20:43,330
different operations depending upon
conditions so what we need to do here is

296
00:20:43,330 --> 00:20:53,169
we need to say if they enter plus then
we need to provide output based on

297
00:20:53,170 --> 00:20:57,880
edition and then we're going to also do
exactly the same thing with subtraction

298
00:20:57,880 --> 00:21:01,840
multiplication and division will just
keep that there because we're smart we

299
00:21:01,840 --> 00:21:03,850
don't need to type out all that

300
00:21:03,850 --> 00:21:08,500
so then after we have that basically
depending upon whatever the condition is

301
00:21:08,500 --> 00:21:15,160
we are then going to come in here and we
are going to print the result and then

302
00:21:15,160 --> 00:21:18,340
our program is going to end because we
don't really need to do anything else

303
00:21:18,940 --> 00:21:24,700
alright so store the user input of two
numbers and the operator also feel free

304
00:21:24,700 --> 00:21:29,860
to pause the video anytime you would
like to if you want to go and see if you

305
00:21:29,860 --> 00:21:31,178
can do it the right way

306
00:21:31,179 --> 00:21:35,020
so what I'm going to say is number one
and an operator and number two

307
00:21:35,720 --> 00:21:40,400
and i want to receive the input for this
and i'm going to type out

308
00:21:40,400 --> 00:21:47,030
enter calculation and then i will need
to split those guys based off of white

309
00:21:47,030 --> 00:21:54,530
space and then need to convert number
one into an integer and to do so we go

310
00:21:54,530 --> 00:21:59,629
and call our int function then we're
going to do exactly the same thing for

311
00:21:59,630 --> 00:22:01,159
number two

312
00:22:01,159 --> 00:22:04,549
and there's number two and there is
number two again we're not doing it for

313
00:22:04,549 --> 00:22:06,080
one of the operator

314
00:22:06,080 --> 00:22:10,699
well then that brings us to if and how
to perform different operations based

315
00:22:10,700 --> 00:22:12,169
off of conditions

316
00:22:12,169 --> 00:22:17,900
so how we use if is pretty easy we just
type in if the operator

317
00:22:17,900 --> 00:22:23,419
they entered in is equal to and remember
it wasn't converted in anything so it's

318
00:22:23,419 --> 00:22:25,850
still strengths we have to put it
between quotes

319
00:22:25,850 --> 00:22:30,889
we're going to say if the value for
operator is equal to the plus sun will

320
00:22:30,890 --> 00:22:33,770
then put in our little :

321
00:22:33,770 --> 00:22:37,370
and then we need to put some white space
inside of here

322
00:22:37,370 --> 00:22:41,418
that's the way python works that that's
the way the Python knows that everything

323
00:22:41,419 --> 00:22:45,650
underneath here that's indented belongs
to this condition if this condition

324
00:22:45,650 --> 00:22:46,640
comes true

325
00:22:46,640 --> 00:22:50,270
this is what's going to be executed and
what specifically is going to be

326
00:22:50,270 --> 00:22:54,918
executed is are formatted data so we're
going to go and put our little curly

327
00:22:54,919 --> 00:22:59,030
brackets inside of there again more
curly brackets and then we're going to

328
00:22:59,030 --> 00:23:03,530
have another Road America and then we're
going to say format and then this is

329
00:23:03,530 --> 00:23:04,668
going to be kind of neat

330
00:23:04,669 --> 00:23:09,440
we can go Nam one inside of there and
num2 inside of there

331
00:23:09,440 --> 00:23:12,530
but you're probably saying why didn't
you do the calculation for this song

332
00:23:12,530 --> 00:23:16,190
what you can do the calculation directly
inside of here

333
00:23:16,190 --> 00:23:19,309
so that's pretty cool stuff and that's
all we want to do because we know the

334
00:23:19,309 --> 00:23:22,190
operator we know the numbers we don't
want to do anything else

335
00:23:22,190 --> 00:23:27,559
so we want to jump out of that condition
and basically exit the program unless

336
00:23:27,559 --> 00:23:34,190
the value for operator is not equal to
plus in that situation we say else if

337
00:23:34,190 --> 00:23:38,690
but the people that designed python
we're really cool funny people

338
00:23:39,200 --> 00:23:43,669
and they decided to just abbreviate that
too LF exactly like that

339
00:23:43,669 --> 00:23:46,970
so now we're going to say operator is
equal to

340
00:23:46,970 --> 00:23:51,740
and here we are going to say - and we're
going to put our little : inside of

341
00:23:51,740 --> 00:23:56,510
there again and in this situation we're
just going to do a subtraction we want

342
00:23:56,510 --> 00:23:57,559
to tab in there

343
00:23:57,559 --> 00:24:01,070
print this right here throw in our
subtraction right there throwing our

344
00:24:01,070 --> 00:24:04,070
subtraction right here and there were
ready to go

345
00:24:04,070 --> 00:24:07,908
and now we need to check the rest so
we'll do an else if the other two

346
00:24:07,909 --> 00:24:09,559
conditions were not true

347
00:24:09,559 --> 00:24:13,039
what are we going to do for that side of
their we're going to check if this was

348
00:24:13,039 --> 00:24:14,179
multiplication

349
00:24:14,179 --> 00:24:16,700
we're going to change that to
modification and then we're going to

350
00:24:16,700 --> 00:24:20,000
change that to multiplication and then
we have another one

351
00:24:20,000 --> 00:24:23,389
and in this situation that's going to be
subtraction or that's going to be

352
00:24:23,389 --> 00:24:23,959
division

353
00:24:23,960 --> 00:24:27,440
sorry about that and we're going to
throw in division and here we will do a

354
00:24:27,440 --> 00:24:28,220
division

355
00:24:28,220 --> 00:24:31,940
but what if they didn't enter anything I
or they entered something that wasn't

356
00:24:31,940 --> 00:24:33,169
one of those things

357
00:24:33,169 --> 00:24:36,980
well in that situation there is a
capsule and that catch all is known as

358
00:24:36,980 --> 00:24:37,730
else

359
00:24:37,730 --> 00:24:40,789
so in that situation we're going to
command and we're going to print a

360
00:24:40,789 --> 00:24:48,200
different message that was going to say
use either plus minus multiplication or

361
00:24:48,200 --> 00:24:50,840
division next time

362
00:24:50,840 --> 00:24:55,370
and there we are and that is all that we
need to do here so we're going to save

363
00:24:55,370 --> 00:24:59,178
that and we are going to run it and they
can come in here and go enter

364
00:24:59,179 --> 00:25:00,289
calculation

365
00:25:00,289 --> 00:25:04,039
look at me being silly i didn't come in
here and put a space in there in your

366
00:25:04,039 --> 00:25:05,840
calculation say that

367
00:25:05,840 --> 00:25:11,870
let's run it again enter calculation and
we can come and say 5 plus 4 and it's

368
00:25:11,870 --> 00:25:15,799
going to automatically perform that
calculation forest will also be able to

369
00:25:15,799 --> 00:25:21,500
go five times for get exactly the same
results are well different results

370
00:25:21,500 --> 00:25:26,010
obviously this multiplication or we can
come in and say five and

371
00:25:26,010 --> 00:25:29,970
and let's think you maybe want to use
modulus while our program doesn't accept

372
00:25:29,970 --> 00:25:33,780
that and you can see that we get our
little error message there in that

373
00:25:33,780 --> 00:25:34,830
situation

374
00:25:34,830 --> 00:25:39,929
it's also very important to know there
are different ways to perform conditions

375
00:25:39,930 --> 00:25:43,890
as you're going to see as the tutorial
continues you're also going to be able

376
00:25:43,890 --> 00:25:49,740
to check if a value is greater than less
than greater than or equal to less than

377
00:25:49,740 --> 00:25:55,680
or equal to or not equal to and that is
weird but that is the way you check if

378
00:25:55,680 --> 00:26:00,300
two things are not equal to and now what
we're going to do is we're going to do

379
00:26:00,300 --> 00:26:05,399
another example and then you're going to
get another program problem that you're

380
00:26:05,400 --> 00:26:06,750
going to have to work through

381
00:26:06,750 --> 00:26:11,610
in this example what we're basically
going to do is decide if a birthday is

382
00:26:11,610 --> 00:26:12,719
important or not

383
00:26:12,720 --> 00:26:16,950
yes I know it's silly but whatever what
we're going to do is we're going to go

384
00:26:16,950 --> 00:26:24,510
and say something like will provide
different outputs based on age and

385
00:26:24,510 --> 00:26:29,220
there's going to be different conditions
that we have if the age is 1 through 18

386
00:26:29,220 --> 00:26:31,290
while those are very important

387
00:26:31,290 --> 00:26:35,280
so we're going to print out on the
screen that they are important

388
00:26:35,280 --> 00:26:39,960
we are then also going to come in here
and in some countries if you are the age

389
00:26:39,960 --> 00:26:46,200
of 21 or 50 or you have an age that is
greater than 65

390
00:26:46,200 --> 00:26:51,990
that is also considered important and so
we will act as if they are important and

391
00:26:51,990 --> 00:26:55,320
then finally all the other four people
myself included

392
00:26:56,100 --> 00:27:00,750
we're going to say that their birthday
is not important

393
00:27:00,750 --> 00:27:04,530
I'm sorry about that but that's just
what i came up with for example to

394
00:27:04,530 --> 00:27:08,700
mainly show you how to use logical
operators and you're going to see more

395
00:27:08,700 --> 00:27:10,050
of those here in a second

396
00:27:10,050 --> 00:27:13,740
so basically what we want to do here is
I'm going to show you a new way to

397
00:27:13,740 --> 00:27:18,630
automatically convert the string that we
get from input into an integer

398
00:27:18,630 --> 00:27:22,520
what we want to do is we want to receive
age

399
00:27:22,520 --> 00:27:28,910
and store in a variable called age and
then after we do that we are going to

400
00:27:28,910 --> 00:27:33,680
say we're going to use an if statement
again and we're going to say if age is

401
00:27:33,680 --> 00:27:44,840
both greater than or equal to 1 and less
than or equal to 18

402
00:27:45,440 --> 00:27:49,550
we want to print the important things so
important

403
00:27:49,550 --> 00:27:54,350
what else do we want to do here with our
if statements well we want to say if age

404
00:27:54,350 --> 00:28:02,240
is either 21 or 50 then it's going to be
important also

405
00:28:02,240 --> 00:28:06,470
and then we can also dumb doing this
mainly separately just so i can show you

406
00:28:06,470 --> 00:28:07,700
something else that's neat

407
00:28:07,700 --> 00:28:17,000
we can say that we want to check if age
is less than 65 and then we're going to

408
00:28:17,000 --> 00:28:21,080
use a nifty tool to convert true to
false

409
00:28:21,650 --> 00:28:26,510
all right and you're going to see that
and vice versa that tool you're going to

410
00:28:26,510 --> 00:28:28,100
see in a second and that's it

411
00:28:28,100 --> 00:28:31,820
and of course these are all going to
print the message important important

412
00:28:31,820 --> 00:28:36,560
and then we're also going to have
another thing that's going to say not

413
00:28:36,560 --> 00:28:41,480
important for everybody else and that's
going to be our else

414
00:28:41,480 --> 00:28:45,440
default so we want to receive the age
and we want to store it

415
00:28:45,440 --> 00:28:51,500
well we are going to call age this time
like i said if you want to automatically

416
00:28:51,500 --> 00:28:57,410
convert the string that they input into
an integer you can use eval you can do a

417
00:28:57,410 --> 00:29:01,250
whole bunch of things with EVO but with
this you just refer to it is evaluate

418
00:29:01,250 --> 00:29:06,050
it's going to allow you to be able to
automatically convert strings into

419
00:29:06,050 --> 00:29:07,940
integers in this situation

420
00:29:07,940 --> 00:29:11,540
so that's evil and it's pretty cool and
you're going to see it do even cooler

421
00:29:11,540 --> 00:29:16,070
things later on we are then going to use
what are called logical operators and

422
00:29:16,070 --> 00:29:20,689
they allow you to stack the conditional
operators like the equals 2 not equal to

423
00:29:20,690 --> 00:29:21,389
greater than

424
00:29:21,389 --> 00:29:26,158
greater than or equal to and all those
guys you're going to have and that is

425
00:29:26,159 --> 00:29:32,459
one of what are called the logical
operators and basically if both

426
00:29:32,459 --> 00:29:35,429
conditions are true

427
00:29:35,429 --> 00:29:43,200
it returns true you're also going to
have or and with or if either condition

428
00:29:43,200 --> 00:29:48,179
is true then you get true as a result

429
00:29:48,179 --> 00:29:51,299
and then finally you're going to have
not

430
00:29:51,299 --> 00:29:59,489
and basically not is going to convert a
true condition into a false

431
00:29:59,489 --> 00:30:02,039
so if you give it falls is going to
return true if you give a true it's

432
00:30:02,039 --> 00:30:03,299
going to return false

433
00:30:03,299 --> 00:30:07,320
that's what it does alright so we
received our age here and now let's get

434
00:30:07,320 --> 00:30:11,579
down here and let's start using the
logical and conditional operators that I

435
00:30:11,579 --> 00:30:12,658
talked about already

436
00:30:12,659 --> 00:30:16,889
so here we are going to convert this
we're going to say if age

437
00:30:16,889 --> 00:30:20,488
we're comparing two conditions here so
throw those little parentheses around

438
00:30:20,489 --> 00:30:24,450
there to keep everything neat if the age
is greater than or equal to 1 and we

439
00:30:24,450 --> 00:30:30,719
want to use a logical operator and we
want to say if the age is less than or

440
00:30:30,719 --> 00:30:35,579
equal to 18 in that situation you are
important

441
00:30:35,579 --> 00:30:41,070
so we're going to tell the whole world
that this is an important birthday

442
00:30:41,070 --> 00:30:46,739
then we're going to come down here and
we're going to say LF because this is

443
00:30:46,739 --> 00:30:51,599
going to be a different condition and
we're going to again say age is equal to

444
00:30:51,599 --> 00:30:56,609
21 or age is equal to 50

445
00:30:56,609 --> 00:30:59,570
that's going to cover either one of
those guys

446
00:30:59,570 --> 00:31:04,760
that's why that's good and once again
you are deemed important person or a

447
00:31:04,760 --> 00:31:07,490
person that has an important birthday

448
00:31:07,490 --> 00:31:11,060
so we'll throw that in there then what
we're going to do is the snazzy little

449
00:31:11,060 --> 00:31:14,480
thing in which we are going to convert
in this situation

450
00:31:15,230 --> 00:31:18,260
what you would normally do here I'm just
like i said i'm looking for a reason to

451
00:31:18,260 --> 00:31:18,980
do this

452
00:31:18,980 --> 00:31:24,890
else if I would normally do age is
greater than 65 like that and then print

453
00:31:24,890 --> 00:31:26,180
important birthday

454
00:31:26,180 --> 00:31:30,230
but what I'm going to do is I'm going to
change this to a less than and then I'm

455
00:31:30,230 --> 00:31:35,600
gonna throw not in front of it and that
is going to allow me to get the opposite

456
00:31:35,600 --> 00:31:39,320
you're going to see not being used for
things that are a little bit more

457
00:31:39,320 --> 00:31:42,830
interesting and useful than that but i
just want to show you what not does

458
00:31:42,830 --> 00:31:46,100
converts falses in a true stars trues
and falses ok

459
00:31:46,100 --> 00:31:51,590
and then finally we get to the end here
and we want to say else and then we want

460
00:31:51,590 --> 00:31:57,260
to make the whole world sad by saying
not important birthday or let's be a

461
00:31:57,260 --> 00:31:59,629
little bit nice let's just say sorry

462
00:31:59,630 --> 00:32:03,770
not important ok so at least we said
sorry

463
00:32:03,770 --> 00:32:08,300
there we go we saved that we're going to
run it come down here to the age area

464
00:32:08,300 --> 00:32:12,889
and we're going to enter something like
12 important birthday comes back let's

465
00:32:12,890 --> 00:32:13,610
run it again

466
00:32:13,610 --> 00:32:17,149
now we're going to type in 20 opps sorry
not important

467
00:32:17,150 --> 00:32:21,890
we're going to run it again and we're
going to type in 65 enter important

468
00:32:21,890 --> 00:32:27,260
birthday and we can continue doing this
over and over again until infinity and

469
00:32:27,260 --> 00:32:31,250
there you can see exactly how that works
how conditional operators and logical

470
00:32:31,250 --> 00:32:36,980
operators work together to allow you to
combine condition and now it is time for

471
00:32:36,980 --> 00:32:42,020
a problem this problem is going for to
be basically a person is going to enter

472
00:32:42,020 --> 00:32:46,940
their age and then you are going to
determine what grade they should be in

473
00:32:46,940 --> 00:32:52,970
so if we think about this problem if the
age is five

474
00:32:52,970 --> 00:32:55,070
you are going to print out

475
00:32:55,070 --> 00:33:00,980
the person needs to go to kinder garden
and then work you're going to do is

476
00:33:00,980 --> 00:33:01,610
you're gonna say

477
00:33:01,610 --> 00:33:12,620
ages six through 17 in that situation
goes to grades 1 through 12 and you

478
00:33:12,620 --> 00:33:15,289
should be able to handle those with one
condition

479
00:33:15,289 --> 00:33:24,529
not a whole bunch of them and then if
age is greater than 17 say go to college

480
00:33:24,529 --> 00:33:27,590
and then there's going to be another
condition you're going to have to handle

481
00:33:27,590 --> 00:33:31,580
which I'm going to let it to you to
figure that one out and basically your

482
00:33:31,580 --> 00:33:39,889
goal in this situation is to try to
complete this program with 10 or less

483
00:33:39,889 --> 00:33:41,658
lines

484
00:33:41,659 --> 00:33:45,590
so there you go pause the video refer to
your cheat sheet and see if you can

485
00:33:45,590 --> 00:33:47,658
solve this little problem we got here

486
00:33:47,659 --> 00:33:53,870
alright so we are back again what we're
going to do we're going to ask for the

487
00:33:53,870 --> 00:33:59,689
aged and then we're going to handle this
is the one that I told you you're going

488
00:33:59,690 --> 00:34:04,190
to have to find on your own if age is
less than five

489
00:34:04,190 --> 00:34:09,379
we don't want any toddlers going to
school we are then also special output

490
00:34:09,379 --> 00:34:16,609
just for age 5 being the kindergarten
thing that we had there before and here

491
00:34:16,609 --> 00:34:18,210
what we're going to do is

492
00:34:18,210 --> 00:34:27,480
since a number is the result for ages 6
through 17

493
00:34:27,480 --> 00:34:32,699
we can check them all with one condition

494
00:34:33,449 --> 00:34:37,678
ok may not it may have got that one
doesn't really matter

495
00:34:37,679 --> 00:34:41,250
and then what we're going to do is
handle everyone else

496
00:34:41,790 --> 00:34:45,029
so we're going to come in here and i'm
wondering if maybe whatever you were

497
00:34:45,030 --> 00:34:46,619
asking for the age

498
00:34:46,619 --> 00:34:50,669
if you use eval if you remember the evo
no problem if you didn't then we're

499
00:34:50,668 --> 00:34:55,138
gonna come in and we're going to say
enter age and in this situation i'm

500
00:34:55,139 --> 00:34:58,740
going to remember to put a space inside
of there then we come down here we're

501
00:34:58,740 --> 00:35:05,189
going to handle if age is less than 5 so
if age is less than five

502
00:35:05,190 --> 00:35:10,680
we are going to print out a message and
that message is going to be too young

503
00:35:10,680 --> 00:35:17,879
for school and then we need to come down
here and do LF and in this situation

504
00:35:17,880 --> 00:35:23,099
we're going to say if age is equal to 5

505
00:35:23,099 --> 00:35:27,990
we're going to print another message and
this message is going to be go to

506
00:35:27,990 --> 00:35:32,700
kindergarten and then we're going to
come down here and go

507
00:35:32,700 --> 00:35:37,589
LF and in this situation we're going to
use a conditional as well as a logical

508
00:35:37,589 --> 00:35:41,460
operator we're going to say it if age is
greater than

509
00:35:41,460 --> 00:35:48,330
five number five is being taken up with
kindergarten and age is less than or

510
00:35:48,330 --> 00:35:54,060
equal to 17 in that situation we're
going to print out

511
00:35:54,060 --> 00:35:57,960
well what we're going to do first do a
calculation we're going to say grade is

512
00:35:57,960 --> 00:35:59,339
equal to age

513
00:35:59,339 --> 00:36:02,609
- 5:00 and if you didn't get this don't
worry about it

514
00:36:02,609 --> 00:36:06,330
you're going to get better and better as
you see examples and how they work

515
00:36:06,869 --> 00:36:11,700
you're going to say go to cover the
curly bracket grade and then after this

516
00:36:11,700 --> 00:36:16,410
we're going to call for Matt throw in
the right information and that's going

517
00:36:16,410 --> 00:36:22,140
to be great like that and then otherwise
we're going to come out here and go else

518
00:36:22,140 --> 00:36:26,460
and we're going to print go to college
and we're going to save it and we're

519
00:36:26,460 --> 00:36:29,070
going to run it and enter age

520
00:36:29,070 --> 00:36:32,490
type in 17 go to 12th grade yeah

521
00:36:32,490 --> 00:36:36,118
great i should reword that and said
grade 12 whatever i'm writing these

522
00:36:36,119 --> 00:36:40,619
programs out of my head that's why I
didn't think of that type in five

523
00:36:40,619 --> 00:36:46,500
go to kindergarten run again and here we
are going to say too - young school and

524
00:36:46,500 --> 00:36:50,130
running again and type in 65 and there
you go

525
00:36:50,130 --> 00:36:55,680
so there you go guys that is part 1 of
my learn to programming series and these

526
00:36:55,680 --> 00:36:58,950
problems are going to get more and more
complicated you're going to learn more

527
00:36:58,950 --> 00:37:02,490
and more as the tutorial continues and
this is technically the end of the

528
00:37:02,490 --> 00:37:06,390
tutorial but what I'm going to do now is
show you how to install pycharm on

529
00:37:06,390 --> 00:37:10,859
windows as well as mac and if you don't
want to learn about that you're free to

530
00:37:10,859 --> 00:37:11,970
leave the video

531
00:37:11,970 --> 00:37:14,939
otherwise I'm going to jump over and
show you real quickly how to install

532
00:37:14,940 --> 00:37:20,520
pycharm ok so what we're going to need
to do here first off is get python and

533
00:37:20,520 --> 00:37:22,230
this is for windows

534
00:37:22,230 --> 00:37:23,690
what we're going to do is we're going to
go

535
00:37:23,690 --> 00:37:28,220
a python.org get it forward slash
windows like that are you

536
00:37:28,220 --> 00:37:31,250
you just go to python daughter work and
click on downloads going to show you

537
00:37:31,250 --> 00:37:34,490
this guy right here and then what you're
going to want to do is click right here

538
00:37:34,490 --> 00:37:38,899
where it says Python 3 . 5.1 if it's a
bigger number don't worry about it

539
00:37:38,900 --> 00:37:42,560
this tutorial is no doubt going to work
for it so click on that you're going to

540
00:37:42,560 --> 00:37:45,380
see this page you're going to want to
scroll down your screen and you're going

541
00:37:45,380 --> 00:37:49,880
to come down here where it says windows
x86 executable installer and click on

542
00:37:49,880 --> 00:37:50,390
that

543
00:37:50,390 --> 00:37:54,049
after that downloads down here you're
going to get the option to run it so run

544
00:37:54,050 --> 00:37:57,349
it and then you're going to come down
here and make sure that you click on

545
00:37:57,349 --> 00:38:02,450
install launcher for all users and
definitely add python 3.52 path after

546
00:38:02,450 --> 00:38:06,379
you do that you're going to click on
install now and that's going to load up

547
00:38:06,380 --> 00:38:10,400
and then after it's done setup was
successful and you can close this and

548
00:38:10,400 --> 00:38:11,839
that was easy wasn't it

549
00:38:11,839 --> 00:38:15,440
now what we're going to do is we're
going to install pie chart make sure

550
00:38:15,440 --> 00:38:19,220
that Windows is circle right here and
we're going to use the community version

551
00:38:19,220 --> 00:38:23,598
which is awesome and free and click on
download once again it's going to say

552
00:38:23,599 --> 00:38:27,650
hey it's downloaded let's click on run
and this guy is going to open up we're

553
00:38:27,650 --> 00:38:30,859
going to click on next we're going to
let that be ok

554
00:38:30,859 --> 00:38:34,098
we're going to click on next going to
make sure that you put a little check

555
00:38:34,099 --> 00:38:37,700
mark in here next to the . py click on
next

556
00:38:37,700 --> 00:38:41,839
we can leave everything to be the same
click on install and it will install for

557
00:38:41,839 --> 00:38:42,410
you

558
00:38:42,410 --> 00:38:46,190
and after it's done you can put a check
mark in here run pycharm community

559
00:38:46,190 --> 00:38:50,119
edition and click on finish right down
here more than likely you're not going

560
00:38:50,119 --> 00:38:54,099
to have a previous version of pie charms
and put a check in there and click on OK

561
00:38:54,099 --> 00:38:57,880
and then part charm is going to open up
you can leave everything exactly the way

562
00:38:57,880 --> 00:38:58,599
that it is

563
00:38:58,599 --> 00:39:03,279
click on OK like that and then you're
going to click on create a new project

564
00:39:03,970 --> 00:39:08,589
I went and to find my location as Python
code and then you're going to click on

565
00:39:08,589 --> 00:39:14,109
this little drop-down and make sure you
are using Python 3.5 and you're going to

566
00:39:14,109 --> 00:39:19,538
click on create then we're going to go
and create a new file and to do so

567
00:39:19,539 --> 00:39:25,599
you're going to click on new and file
and then I call this Python touch . py

568
00:39:25,599 --> 00:39:31,089
click on OK and then we're going to
verify that we are using Python 3.5 so

569
00:39:31,089 --> 00:39:37,839
just type in import sis and then on the
next line print sis . version underscore

570
00:39:37,839 --> 00:39:42,640
info like that and then you can
right-click on the screen anywhere and

571
00:39:42,640 --> 00:39:45,788
click on run python tucked and there you
go

572
00:39:45,789 --> 00:39:50,289
and you're going to see major three and
minor five right like that and that is

573
00:39:50,289 --> 00:39:54,789
going to verify that you're using Python
3.5 and you're ready to go and that's

574
00:39:54,789 --> 00:39:58,089
all you need to do everything set up and
now i'm going to show you how to install

575
00:39:58,089 --> 00:40:00,940
Python on a Macintosh

576
00:40:00,940 --> 00:40:06,700
so here you go you're going to go to
python.org /a downloads to install from

577
00:40:06,700 --> 00:40:10,629
Mac it's going to say latest version for
mac OS x and we're going to click on

578
00:40:10,630 --> 00:40:14,410
download Python three point five point
one and don't worry if it's a bigger

579
00:40:14,410 --> 00:40:17,499
number it's more than likely going to
work after it downloads you're going to

580
00:40:17,499 --> 00:40:21,759
come down here click on this little
downward facing arrow click on open and

581
00:40:21,759 --> 00:40:25,359
there it's going to open up for you now
it's time to install Python we're going

582
00:40:25,359 --> 00:40:26,859
to click on continue

583
00:40:26,859 --> 00:40:27,540
you're going to cook

584
00:40:27,540 --> 00:40:32,190
continue and you're going to click on
continue anyone around to agree to that

585
00:40:32,190 --> 00:40:36,690
and you're going to install probably
gonna have to type in your password and

586
00:40:36,690 --> 00:40:40,830
install software and it will take a
little bit of time to install and then

587
00:40:40,830 --> 00:40:44,549
it's going to say installation was
successful and everything is awesome and

588
00:40:44,550 --> 00:40:48,990
we're going to close that now it's time
to get pycharm and to get pycharm you're

589
00:40:48,990 --> 00:40:54,870
going to go to jet brains . com /by
charm download and you're going to click

590
00:40:54,870 --> 00:40:56,279
on community

591
00:40:56,280 --> 00:40:59,340
download and it's going to download
you're going to click on this little

592
00:40:59,340 --> 00:41:03,990
arrow right here and then click on open
and then really simply you're going to

593
00:41:03,990 --> 00:41:07,620
come over here and grab this guy and
drag it into the applications folder

594
00:41:07,620 --> 00:41:10,500
like you do all the time and it will be
loaded

595
00:41:10,500 --> 00:41:15,330
now you can go into the applications
folder and double-click on pycharm Cee

596
00:41:15,330 --> 00:41:19,230
and pycharm will open then you're going
to come over here and you're going to

597
00:41:19,230 --> 00:41:21,900
click on edit configurations click this
guy

598
00:41:21,900 --> 00:41:26,640
edit configurations and then inside of
it you're going to name this Python

599
00:41:26,640 --> 00:41:32,790
touch . py and then make sure that you
click on this little guy and you select

600
00:41:32,790 --> 00:41:37,529
Python 3 . 5.1 or whatever the new
version is right after that and then

601
00:41:37,530 --> 00:41:41,340
you're going to click on OK and be able
to start writing some programs

602
00:41:41,340 --> 00:41:46,080
so there you go guys that is a start of
my learn to program with python tutorial

603
00:41:46,080 --> 00:41:51,390
as well as how to install pycharm and
set up python on both windows as well as

604
00:41:51,390 --> 00:41:52,529
on Macintosh

605
00:41:52,530 --> 00:41:57,180
please if anything confused you leave
your questions and comments below of the

606
00:41:57,180 --> 00:41:58,140
last till next time


