Led by: Manal Sultan(Treasurer)

Transcript:

00:00,00:07

i would do this by doing x equals and then the

number or i would be doing a quotation of what i

00:07,00:13

wanted to do right so that's what's interesting

about python is like in other languages like

00:13,0:00

java you usually have to assign like what type of

variable it is but python will essentially do this

00:19,00:25

automatically for you so if you were to do

x equals 5 and then do print and inside the

00:25,00:31

parenthesis just the x so that the computer knows

that you're looking for just x rather than like

00:31,00:38

the letter x you're going to see that like it's

going to print the value that's inside of it

00:41,00:43

so then now we're going to try printing a string

00:44,00:50

so the way we're going to do that is that we're

going to do x equals and then what a string is

00:52,00:58

this is basically just like language so like it's

going to be like English letters in the alphabet

00:58,01:02

and whatnot instead of like a number so you could

make this like multiple sentences or whatnot it's

01:02,01:11

just what you want it to be so like Daniel showing

here if you did like abcdefg it's gonna show that

01:12,01:22

so let's say you were to assign a variable of

both a string and an integer or a number let's

01:22,01:29

see what would happen so let's do x equals

abcdefg and then let's do x equals 5 right

01:30,01:32

below it and see what the computer prints out

01:34,01:38

so it's going to print out 5 because

that was your most recent number

01:38,01:43

so the way the computer understands this is

that it believes that you had changed the value

01:43,01:48

of the variable right so it thinks you've

not only gone from a string to an integer

01:48,01:53

but you change the value of it so it's

not like a b c d e f g but it's five right

01:55,02:00

so it's going to look at what you had most

recently put in for that so if you wanted to

02:00,02:07

change this you would have to assign different

variables for the different values you put in

02:08,02:21

but this runs into a problem if you want to print

it on one line so try printing x and then plus y

02:22,02:29

this isn't going to show because of the fact

that they're not only two different like classes

02:29,02:37

of variables but due to the fact that um it's

going to try to add them together because that's

02:37,02:42

what it thinks you're trying to do because of the

math function of using like a plus operator right

02:44,02:50

so when you the way to get around this is that

you're going to do print and then um you're going

02:50,02:58

to put string or str which is shortened for string

and you're going to put a parentheses a pair of

02:58,03:05

parentheses around that and then put the string

variables name so in this case it would be x

03:14,03:19

and then you would make y the first

part but you can just leave y as is

03:24,03:31

wait did you change it or am i lagging

03:33,03:38

str and then the pair of parentheses

and that would be x and then plus y

03:40,03:45

then try printing that

03:49,03:51

wait say that again mine logged

03:59,04:13

oh yes dude do it that way yeah sorry

04:18,04:24

so yeah now it shows up here and then if you

wanted to do a space what you would have to do

04:24,04:33

is that like you would have to set operate it

by using um and you by separating it into three

04:33,04:44

different like factors of the plus and then

do two quotes within it so now it's spaced out

04:49,04:55

so for Boolean what a Boolean is it's an operator

that's going to give you back true or false

04:56,05:01

so if the statement you give to it is false oh

yeah also what Daniel just did there's called a

05:01,05:06

comment where you're for python you're going to

put a hashtag and then you can basically take

05:06,05:10

out lines of code that you're just writing so

you like you remember what the function of like

05:10,05:15

that portion of your code is right so it's not

going to actually affect the code and like your

05:15,05:22

computer isn't going to read it yeah that's a

comment so now on to Boolean uh basically if i

05:22,05:30

were to put like bool and then in parentheses

y let's see what the pewter puts in for that

05:37,05:42

so the computer is going to basically take

any type of variable and as long as it's

05:42,05:52

not a literally false statement so like if

I were to put like five is less than one

05:52,05:57

it's not going to accept this because it's going

to think that you're essentially giving it like

05:57,06:02

a false statement based on like the laws of

mathematics and it's going to give you false

06:02,06:09

but if you're just asking for like if a variable

is true or not then it's going to give you true

06:10,06:16

so that applies to virtually all type of variables

you would try to assign a Boolean to but there are

06:16,06:22

some in which it's going to automatically give you

a false so for example try putting in rules zero

06:28,06:32

it's going to give you a false

because it's not taking that as a true

06:32,06:47

integer necessarily because of the fact

it's a zero so if you try doing bool none

06:49,06:53

it's not going to accept that either

because it'll say that that's false as well

06:57,07:02

so what I want you to do now is to like try and

mess around with this so not only do i want you

07:03,07:09

to list two different types of variables one

of an integer in one of a string i want you

07:09,07:15

to mesh those together and then try assigning a

Boolean to each of those variables and see what

07:15,07:21

your console outputs so just basically the way

that Daniel has it right here where it's x equals

07:22,07:28

and then your string and then y equals and then

your integer and then he has them concatenated

07:28,07:33

which means combining them together on the print

function right there and then below that he has a

07:33,07:40

Boolean so instead of putting none there you could

put like x or y and see what comes out of it which

07:40,07:50

should be true by the way so yeah you you all can

try that on your own uh ide and see what pops up

07:56,07:58

what would a bullying be useful for

08:00,08:06

so basically later on so I guess next week it

would be I'm going to be teaching if statements

08:06,08:12

as well so if you wanted to find out whether or

not the condition you're giving for your code

08:12,08:17

to be true it's going to tell you whether

or not it's going to be true or false right

08:17,08:22

so if something about this condition is true

then that means your code is going to run

08:22,08:26

but if it's false then it's going to reject

that part and then go to your else statement

08:33,08:41

okay thank you also um the way that they're going

to be sized is that a Boolean is going to be the

08:41,08:47

smallest type because it's true or false and then

an integer is going to be the second smallest

08:48,08:53

and technically python doesn't really have

doubled because it just assigns them the same way

08:53,08:59

but a double would be larger and that's when

you use like decimals within it and then um a

08:59,09:04

string would be the longest because you're using

different letters and spaces and characters and

09:04,09:07

whatnot

09:16,09:18

yeah the like memory it takes up on your

09:18,09:26

computer so like computers like when they were

first made it couldn't take up like a lot of

09:26,09:31

code because to physically use a computer

you had to program technically you had to

09:31,09:37

have that type of knowledge but now like we can

just use an operating system like windows right

09:37,09:42

but before you actually had a program to use

it and there wasn't a lot of memory on those

09:42,09:48

so like one megabyte would be considered very

very small right now right like computers could

09:48,09:53

accept even less than that and like 50 megabytes

was considered like a norm within like the 90s

09:56,10:01

so even though like storage it doesn't really

matter that much anymore it used to matter a

10:01,10:10

lot in like the really early days of computing

well okay but mac is prettier Daniel that is

10:13,10:15

you're not wrong