LEARNING DATA SCIENCE , WEEK 2

 PYTHON KEYWORDS

Python keywords are special reserved words that have specific meanings and purposes and can not be used for anything but those specific purposes.

Note: There is a function in python ,when you execute that it will show the list of python keywords.

FUNCTION - help('keywords')


PYTHON IDENTIFIERS

Variable - Anything which holds certain value.

The identifier is used to identify an entirely unique in a program at the time of execution.

Example - name = 'ANSHULA'

name is representing unique identity ANSHULA .

There are few rules to define identifiers.

1. Use only alphabets , numbers or underscore.

2. Use of Special characters and keywords is not allowed.

3. Starting characters should be either underscore or alphabets , numbers are not allowed.



COMMENT IN PYTHON

 Comment is additonal information about the code you have written so that other developer can understand that code, in case he wants to reprogram that code.

# - Using this means you are writting a comment , python complier will ignore that statement.

There are two types of comment 

1. Single line comment

2. Multi - line comment 

- For writing Multi- line comment use "'  at the starting of the comment and end that comment with  '''.



PYTHON DOC STRING

Doc string are special forms of characters that are used to document functions , classes and modules.

Doc string describe the intent, arguments and return value of functions and classes.

They are often contained in triple quoted string and put right after the functions or classes .


INDENTATION IN PYTHON

In python indentation is used to determine the structure and execution of code blocks.

The level of indentation indicates code blocks , subordinate blocks are indented to right of their parent block.

Indentation is used to separate code blocks in a variety of settings , including conditional statements.


STATEMENTS

A line of code which executes and creates some results is statements.

Statements are fundamental blocks of code that comprise  a python program. They are commands that the python interprets uses to carry out various activities.

Python statements may perform a variety of tasks including setting values to variables making decisions repeating activities in loops and more.

TYPES OF STATEMENTS

1. ASSIGNMENT STATEMENT

An Assigment statement is a statement that is used to set a value to a variable name in a program or assigning the value to a variable.

2. EXPRESSION STATEMENT

An expression is a combination of variables , operators and functions calls that always produces or returns a result value. 

3. CONDITIONAL STATEMENT

Conditional statements are used to instruct the computer on the decision to make when given some conditions.

4. FUNCTION CALL STATEMENT

A function call is an expression containing the function name followed by the function call operator().

5. RETURN STATEMENT

The return statement that you can use inside  a function or a method to send the function's result back to the caller.

6. PASS STATEMENT

Pass statement doesn't return anything and it is used when a statement is required to be present in a program.

7. IMPORT STATEMENT

The import statement allows you to import one or more module into your python program.

8.DEL STATEMENT

Del statement allows you to remove references to objects from a given namespace or container type.

9. LOOP STATEMENT

Looping statement contains instructions that continually repeat until a certain condition is reached.


So until now  i  have learned about some basic terms of python, keywords, identifers,indentation and  statements.



Comments

Popular posts from this blog

PYTHON - OOP(OBJECT ORIENTED PROGRAMMING) - PART 1

How to create Macros in Excel

HOW TO USE SQL?