Python Statement

Python Statement. Instructions that a Python interpreter can execute are called statements. For example, a = 1 is an assignment statement. if statement, for the statementwhile statement etc. are other kinds of statements which will be discussed later.


 Index:

• Proof of Python
     -->Proof of evidence
• Python mode
• Python Comments
    -->several comments
    -->set of documents in Python

Proof of Python

It is an interpreter for Python who can carry out the teaching. For example, a = 1 is a valid declaration. if, in writing, where, etc., are other types of speech that will be discussed.
Python, the end of the training was marked by a new character. But we can make a statement in a few lines with a continuous attitude (\). For example:

a = 1 + 2 + 3 + \
4 + 5 + 6 + \
7 + 8 + 9

This continues to go straight to the line. In Python, the intact, continuous line (), cloth [] and braces {}. For example, we can make a statement on several lines

a = (1 + 2 + 3 +
4 + 5 + 6 +
7 + 8 + 9)  


Proof of evidence:

Most languages such as C, C ++, Java use bræ {to define a block of code. Python uses dryness.
Part of the code (body's work, circle, etc.) begins with confusion and ends with the line without previous bleeding. The total sum is about you, but it should be consistent.
Usually, four openings are used for bleeding and other items such as Tab.

Python mode:

The Python code retention request makes it clean and inaccurate. This shows the Python program that looks like the same one.
The device can be ignored by continuing. But it is a good idea at all times. This makes the code readable. For example:
         
for i in range(1,11):
print(i)
if i == 5:
break

Python Comments:

The comments are very important when writing a program. It defines what is in the program so that the person looks at the secret code does not have a hard time to detect. You may forget the important details of the program only in the month. So take a moment to describe this idea in many contexts.
In Python, we use a sign indicator (#) to start writing comments.

#print out Hello
print('Hello')
It looks like a new character. The comments are from computers to understand the program. Python language ignores comments.
If we have a comment on the line, one way to do is to use the shadow (#) at the beginning of each line. 

#This is a long comment
#and it extends
#to multiple lines

Several comments:

Other ways to do this should be to use the third source, '' 'or' ''.
Third terms are often used for several chains. However, it can be used for many different comments. An exception to the documents, except that they are not done, which are not issued by another law.

"""This is also a
perfect example of
multi-line comments"""

Set of documents in Python:

The text is abbreviated to the document chains.
This is the line that is presented as the first module of the module, work, class, method or mediation. We need to write a class/class not a document in the document.
The third points that use when writing texts. 
 
def double(num):
"""Function to double the value"""
return 2*num

Comments

Popular posts from this blog

Python – Functions

Python Global Keyword

What is Django in python?