Biton statements and comments.
So at first, we're discussing Biton statement instructions that a Python interpreter can execute will
be known as a statement.
For example, say count is a glucan, is an assignment, statement if statement, false statement while
statement, etc..
So these are the examples of statement.
You can also issue multiline statements.
So that means in Python, end of a statement is marked by a new line character.
But we can make a statement in it over multiple lines with the line condition marker that is our backslash
here.
So for example, you can consider this.
Let us suppose I want to write welcome to the world of programming, but due to some design, I do not
want to write this statement in one line.
I want to break it up into multiple lines.
In that case, we are supposed to put one continuation marker at the end of the statement.
That is our backslash.
So in this way, if you go on writing that interpreter, you'll think will consider this particular
line.
That is a line statement is nothing but a single line statement and it will get executed accordingly.
Next, we are going for Biton indentation.
So that is very interesting, despite an indentation is very interesting.
So like other programming languages as example C or C++ or Java, we use Karlee process to denote a
block to define a block of code.
But I use Python uses indentation.
So as this particular example, you just see that this part is starting with this particular indentation.
This is the inner four.
There is a nested for, we can say.
So that's why it is having a different indentation here.
This print, Ikoma G is within this nested for that within this within the body of the inner four.
So that's why it is having another indentation.
So what is happening?
We are not supposed to put any begin or end any curlew process to denote the block begin and block and
markers.
That scope is not there in Python.
That indentation will make us feel that this particular statement or these are the set of statements
are under one block.
So they will have a separate indentation.
So intent and update will be very much interesting in python coding.
Next one, we are having the Python comments, so in Python, use the simple hash, so this has to start
writing a line comment.
So whenever we are supposed to write a comment line, so comment line is very important.
So they pick the purpose of the program.
It will depict the purpose of a block code.
So comment insertion of common in our programming is a good programmers practice.
So that's why how to write this single line comment.
So in that case, the comment line must be preceded by the hash symbol in case of Python.
Different languages that have different syntax has to write the respective single end comment.
But in Python it is starting with this preceded by this symbol.
Whenever you are supposed to write multiline comments like this mountable line Sadir in the comment
block, so if we have comments that extend multiple lines, one way of doing it to use symbol at the
beginning of each and every line.
Consider this one.
So here you are having the line come in.
So in this program, we have used functions and iterations so it can be enclosed.
It can be done in this way that for each and every line at the beginning are putting the hash symbol.
Another way of doing this is to use a triple kautz, either using the single triple or double quotes
three times.
So this triple courts are generally used to multiline strings, but they can be used as multiline comment
as well, unless they are not doch string.
What is a string will be coming in the next slide and they do not generate an extra code as example.
So now here you see there is a multiline come in.
I can have multiple number of lines there, but the first line will have will be presented by this trist
single code and the last line will be having that single code at the end.
We can also use double code in place of single code, but in both cases will be using them for three
times.
So that is the way to write the multiple incoming.
So now let me discuss what is a dark string, so dark string is a short form of documentation string,
so it is a string that occurs at the first statement in a model, a function, a class or method definition.
So that should be the first statement.
And we must write what a function class does in the dark string.
So in the string we shall mention the purpose of the respective function or the model or the class.
I think for the better understanding, let us go for some practical demonstration.
And that is the demonstration.
For a single comment, we can use Hash Brown, this comment line, and that will make the line under
comment.
So it has its respective marker, which will indicate that this line is a comedy line.
So during execution, these lines are not going to get executed in case of Microland comment.
We can go for triple double code.
Or you can go for triple single code four, including the block of the text, so if we execute this
this part, we can find that this Martland comments can also be written like this, or this particular
statement will be printed like this one, but it will not be interpreted.
It is just a printing mere printing this line.
So this line is not getting executed here.
So instead of having this triple double code, so you can also go for triple single code here, you
can easily find that I'm just putting triple single code.
So there also I'm going to get the same outcome for the assignment Rickman will be writing rideable
is equal to expression, so expression will always return a value.
So we are having this one that is available in the gallery exhibition in of Biton assignment streetman.
So if I go on executing that one will be assigned to it in case of my statement.
So explicit line contention can be used this splashier.
So this is our backslash so you can find that B is equal to one plus two plus three plus.
So this is a continuation marker four plus plus six.
So what will happen?
It will be considered internally that for part of four, five and six are getting added with this one
plus two plus three.
So I can write in this way, just making a separate new line for four plus five plus six and putting
one contingent marker here.
Other is this four plus five plus six can be written.
I just gently in the previous row.
So now if we print the value of B.
I'm getting the value as this, so there is a 21, I'm getting the value of B because this is my six
and if you go on adding, this is also another 15.
So that is six plus 15.
We're going to get here 21.
So implicit contention is always there if you put brackets.
So that is there is no need to put any any kind of splashier.
So it'll be treated as implicit line contamination.
So if you go on printing, it is printing 21.
So here, if I put the slash, then what will happen?
It will produce the same output, but this slash giving is optional.
This backslash giving is optional because it is enclosed within brackets.
So implicit contention will be there.
What having this one, there is a statement in one line.
So anybody who are trying to write multiple statements in one line, we can separate them by the semicolon
here.
So here you see the if you print the value of D e and if you can find that the respective values are
getting printed, that is one three and zero.
So my statements can be written in a single line.
But here the statements must be separated by the semicolon and in the last statement does not equal
a semicolon here.
So now next one.
So there is a code block.
There is a body of a function loop that starts with the starts with the indentation and ends with the
first on indented line.
So you can find that.
So these are for statement we have written.
So there is the indented line here and this is out of the block we are starting.
So this line has got in the net in that case and is a first on indented statement.
So that means this line is outside of this respective four block.
So in this way we are getting this output equal.
See this line end of the program, this print end of the program is outside of the four blocks.
So that's why it has got printed once only.
So that indicate that which line is under which block are which line is outside of each block.
So that will be decided only by the indentation that is.
No, Culebra says there is no beginning to denote the block begin and block and markers.
Thanks for watching this video.