okay ,so
can we also in this um
let's get rid of this because why now i'm just going
to add to this particular cell so let's let's so .so
let's say so we need to change the marketing number
mark down
trying
crying what i ,actually
i thought ,so ,try .yeah
i just want to make sure that the end gives us the same
.thing
i don't know where you go see say it is me but it knows
itself
what a float or an integer looks like but there's no
type as such for the syntax so trying .to
trying ,to ,define
a data type
this will get saved a data type .using
it
float ,etc
use the syntax error use a syntax
error
so this is good the more questions you ask me the more
i can update my notes as well .because
the question is what makes life
actually
easy there we go so trying to and let's run .that
said that that's now become part of the notes okay
.so
three point five here are some exercises for you to
later on not .now
okay input from the keyboard right so this is very
very useful i will look at this cell
this
there's a function called input which takes a string
okay ,so
have a look at this let's run this x equals input right
it takes a string like .that
and then i'm simply saying print allow x to equal wherever
was typed in and then i'm asking what's the type and
that's confirmed ,here so if i say
if i type my name .in
okay so can you .see
can you see these two asterisks
i think i've done quite well so .far
and
in that sometimes you get this quite early .on
and if you have loads and loads of n extensions .running
that really can't slow down so just .be
just be mindful of the .fact
that
having a whole load of extensions isn't going to make
you make you more popular .or
it may not necessarily help you find a spouse or something
but the the thing to remember is that it will slow
miss down right just remember .that
so i'm going to now go here and interrupt .that
there we go don't seem to like that and they see can
you see now it says .here
he was interrupted by me
let's ,try ,it again
hopefully this will be a lot .quicker
so let's try it .again
there we go yeah she worked that time right so um i will
tell you up until about a year ago that that stop button
which is interrupting the kernel
didn't actually work
and even by going up here interrupting there or restarting
the only thing that would often work is restart and
clear output so ,the ,speed at which .they
updating this all the time
is is very rapid so you have nothing to worry about
those of you who are coming into title for the first
.time
you're lucky because you haven't seen the evolution
of the notebook
even though the final results are visually .stunning
um it's required a lot more work than it has in the past
and to give you the heads up were advanced .warning
what you can do is because all of this stuff is linked
if you can download this when you're free
m ,s visual
studio
community
well that's something that's something for you to do .again
there are some like bedtime reading download this
visual community
um it won't work for the i think for for those of you
who .have
max will need x code .so
sorry ,about that
but
download ,this
microsoft visual studio community
the reservation of the street came to a mac
i'm pretty sure that there are .some
there are some issues with this because when i teach
this at university
um it hasn't been quite the same .thing
no it does not work for mac yes thank you because i've
done this i've ,done ,this live in classes
where
the ,map people
have problems
i'm ,pretty sure
you can also use v s
but is that the same christopher is that the same as
this .though
you can't run this you can't download this onto a mac
machine as far as i know yeah so it's a light
exactly so it's not the same thing that's the thing
i'm trying to get across that i've i've been in classrooms
with a lot of students for some odd reason most students
tend to go for a mac
yeah i guess if you if you mumbled out of paying for
it then why not and it's not ,the ,same ,thing ,at ,all
i should know my son forced me to buy him when he first
started university i was shocked at what you what
you pay and we get in return it ,appeared ,that in most
cases
the apple iphone had a larger hard drive than um
an apple mic
laptop so so this is the other thing that you should
get ready for .hopefully
it's probably one of the best times to be programming
given the amount of stuff that's freely available
now are you saying that if i if i give you ,code written
on windows
you can immediately open it up
and running without any problems on the version that
you're talking .about
depends if it is dot net
what is what will we use for the original studio for
amber this is what the c plus plus .is
i'll i'll put an online video on how to download this
anyway
it's it's going to be for c plus mostly likely not here
we were interested in c plus plus c not c shop
as you will use m s own stuff .okay
all right this is between now and the start of the course
the best time for you to be doing as .much
programming and mathematics as you possibly can
alright and i'm here between now and the ,start ,i'm
,not traveling .anywhere
until a vaccine is found and robustly tested for at
least five years i'm not traveling anywhere so i'll
be available right over christmas ,to ,help ,anyone
with .anything
in ,preparation ,for january
will we use vs
python code at all no david um i it's always best to
.use
the ,standard
for each thing so as far as i'm .concerned
for python this is what you're going to focus on because
you're going to be using this for submitting all your
projects and all your exams at the ,end ,of ,each month
uh because it makes marking particularly easy and
then it's got everything in one place and that's the
reason why i'm also ,going ,to ,run marked down
sessions ,as ,well .so
you can see precisely um what about spider um the carlos
the actual version you have to submit has to ,be ,in
,as ,an anaconda
if you use c plus plus or v b a that's fine you will then
convert it into a p d f however if you're going to be
using a python we then expect it to be submitted
as a python notebook because then what will happen
is we can run the code to check .it
also
any math that you've typed up or any graphics any tables
and stuff we can see very very .clearly
okay so it allows us to also run the code that you submitted
and that's the reason why we expected what's the best
way to reach out uh good question uh my email address
which i'll type over .here
right so it's just my first name
dot surname
and fish
learning
dot com
so since we're going to be meeting again for the math
primer
as far as the math is concerned you can email me questions
if we then need to .discuss
uh just confirmed v s or mac will not support c plus
plus thank you for confirming that the reason why
i know already is because of the problems that i have
when i do this with the university classes
about seventy percent of any class
well
um we'll have a we'll have a bat will have a mac
given that i've written all my stuff in windows that
does sometimes create problems so what's happened
is that .i've
asked one student in every class to help out .because
um
and they run into problems then i certainly don't
know how the mac works if you have a mac options for
,mac ,x code .okay
right so i hope everyone is noting this down
but given that a lot of you tend to have seem to have
windows for me it's quite refreshing that most ,of
,you ,have got windows
and i .i
know how windows work
okay ,so ,data types
uh when defining variable names they should contain
numbers letters and underscores please make sure
that your data types are actually meaningful right
if you if you've if you're ,going to .have
a call option
then call it call the data type call
don't call it bigfoot i know there's a there's a person
at university when i was a first year undergraduate
and that's the kind of chilly things he used to do it
called it gives us um variables is really really chilly
names like .that
so uh make sure they're nice and .meaningful
make sure that you don't include
a built in function as a name
nor any reserved word but then you'll soon find out
which are the reserved words .because
it ,tells us
the reason why i also have suggested that you download
c plus plus i will also then in the meantime make my
notes available which again are written like a textbook
and it's got full instructions however i'll i'll
.do
i will do a video on how to do this and then we'll ,start
recording the lectures
um
the one problem i do have .is
most of you will have found if you don't program on
a regular basis you do ,tend ,to forget the syntax
i sometimes do that's not a very good advert for learning
two languages at the same time i do um occasionally
mix up
uh syntax statements uh between c plus plus and python
but when you do this on a regular basis and by regular
i mean even if you write one program every day you can
never forget then so if it's no different from doing
math or learning a language or playing an instrument
okay so the types of function uh sorry uh declarations
that are allowed are given down .here
alright so these are all examples of names you can
.give
now shame on me i i i even got this .here
after saying what i just said
right ,so
you can you can have any string like .that
hi
without the uh
the speech box
you can't start off with a number alright so um you
can have anything like this if you if you got something
long like you actually want to call it call option
then call .it
write down coal underscore option just to make a bit
more meaningful and easy to read rather than having
one very long ,word ,consisting ,of multiple words
the following are illegal so these are all legal we'll
soon find out what's legal and illegal these are ,all
,examples ,of ,illegal decorations
right ,in ,other words
uh the way you define a particular variable type
the ,following ,are ,illegal names
uh this one
you should get to that stage anyway because that's
the reserved word cried .for
uh you can't have things like this reminds me of the
the early eighties of pascal programming when you
wrote down
remember equals is essentially a and this equal is
not the same equal as ,as a mass
equal sign
that is a logical test equal this is an assignment
so when you say that x equals three you're simply saying
that you're assigning the value three to x rather
than saying x equals three although you and i know
now this is saying x equals three
in ,the ,old days
this was to say that x becomes one
okay
right so you can look some of you are uploading different
addresses the advantage of learning python .is
the huge community
and everyone is very helpful
so with python you just can't get lost
the other advantage of python .is
because it's interpreted it's a very forgiving there's
less chance of getting an error message unless you
actually do something quite bad
most most the the syntax that you run will will get
interpreted uh you won't get an error message ,a ,word
,about ,warning messages
warning messages whilst they will still let your
program run
the logic or the rule of thumb about warning messages
is .that
they end up
essentially equating to an error so if you do get a
warning message try and act on a warning message when
you receive .it
we've already done multiple variables um sorry yeah
we did this early ron didn't we what was that .actual
those are actual executions so yeah you can have multiple
assignments so here's x equals three so there we go
we have one line uh and this is where the semi colon
is coming .in
is simply as way of separating .out
um rather than to say his memory is no compiler here
so always simply saying here is that these are all
assignments and we're separating each ,one ,out
,by ,a ,semicolon
he said he makes them more readable
x is uh an integer uh pi is built in right so um
that should ,actually
really
who's that going to run
it has
good insert uh run
now remember when we used semicolons .before
sorry the important thing i .forgot
explicitly say this comments follow a hashtag or
an octopus okay so that's that um let me .just
i just want to quickly just for .you
benefit
um
x dot pi uh x comma pi
common name
alright so when you do it this way then it appears as
a couple
right so there is a slight difference
but again all we're doing is we're displaying .this
but
when we did
in the semi cologne before .remember
he was basically treating each thing as a statement
and then all it did was .simply
uh displayed the last term hence if you are going to
display .something
probably the best thing is to use the print function
okay ,so
now i can't remember oh here we are i d all i did was .fortunately
i commented it out .so
so david is being i is asking what's the difference
between a tupple and a list now sorry when i use the
word topple there um i was using the word tupple in
the sense of
of a mathematical definition lists and topples like
data structures which will be doing later .on
in the case of lists you can change them in the case
of topples you .can't
but functioned function parameters are actually
read in david as taboos now what i meant by a tupple
in this particular case was um i actually use the word
region .generally
topple as in think about a vector imagine you got a
vector x comma y comma z surrounded by a pair of round
brackets we often call a tupple
so if you got a veteran n dimensional we call it an n
topple so it was more of a maths definition rather
,than ,something in python programming
so ,apologies ,for .that
alright um ,from
right uh george from i python currents uh interactivity
or this is good coding if you want to pay all the outputs
not just the last one
thank you so we've got um also .some
uh good suggestions coming in .from
about ,the
how to get everything effectively in one
without using the print statement george you are
talking about the just displaying without ,actually
,physically ,printing correct
thank ,you
no
uh what's next so some more maths right this .is
now you may see you may see me .occasionally
repeating an import
the reason being is that normally when .i'm
certainly ,for ,teaching purposes
i won't always run every cell so for example if i was
to run the next bit of
python syntax i'd get an error if i didn't have this
.so
um
have a look at this this is this is the last one to talk
about and then we'll we'll stop for a short lunch break
um one one ,thing ,about good programming
um
it says here white space white space is the space that
you whether .it's
space ,between
text or from one line to the next or its indentation
indentation interestingly here actually has a physical
purpose certain code will not work
without the indenting so you have to be careful we'll
talk about that shortly uh python is white space sensitive
for that reason ,i ,will talk about .that
in more detail later on but try and make your programs
as readable as possible so space them out
uh all the uh the syntax now have a look at this x equals
pi and then we .assign
x to y right .so
no
there's a function called id which is essentially
.the
the ,address ,in memory
i'd have a look at .this
um
here's a definition for x equals pi and then we create
a new variable called y which .essentially
is x now in other languages in memory there have been
allocation made for y
because it's a new variable but that's not the case
in python it's recognized the fact that y is actually
the same as x
right so look what happens when we ask for the address
or the i d for x and .why
they're both exactly the .same
wait ,now
why
why is there so if we now say x equals one so x is now given
a different value and we ,ask ,for ,the addresses
.again
lady for x is .this
an id for what makes exactly the .same
so ,let's
have i asked for x and y yeah so they still at the same
place so there's that and x is now why i d for x is .still
the ,same
think so three c is now different
which is what we wanted x is in one six eight and y ends
.in
five eight two four
alright ,so
why has retained the original address is the excess
now .changed
now just before we finish
um i have mentioned a quick note of storage
right so we're not really going to be discussing storage
um so that's something you can look at at least over
the large break mess around with .it