If u fell any difficulty in watching the content, try to reduce the size of this page or rotate your portable device if you are using it
In the previous article, we learnt about some types of literals ans hence completed the part of Tokens.
Today we shall learn about Barebones of Python Program. So, let's start.
Barebones of Python Program
A python program contains many components which contribute collectively to give structure, logic and a better understanding.
Let us know about these components in details:
1. Expressions: Expressions are legal combination of symbols that represent a value. An expression represents something which is evaluated by Python and some values are produced henceforth.
For example: 87
7.5

x-7
(8*4)/4
2. Statement: It is a programming instruction that does something i.e. some action takes place.
For example: print('Hello') #This statement calls the print function
if b>5:
.
.
.
*A statements executes and may or may not yield a value but some processing is absolutely done.
3. Comments: These are some additional information which is read by programmers but ignored by the interpreter.
In Python, comments begin with # before any syntax are called full line comments.
For example:
Comments in between a line after syntax are called inline comments.
For example:
If you want to enter a multi-line comment or a block comment we can use # in every line or by using triple quotes.
For example:
4. Functions: It is a code that has a name and it can be reused (executed again) by specifying its name in the program where needed.
We shall learn more in the upcoming articles.
For example:
5. Blocks & Indentation: Group of one or more statements is called a code-block or suite.
For example:
Here is a collection of every component explained above:
We shall learn about Python Styles and Convensions in the next article.
No comments