Download Python Language Components Handwritten Notes Pdf In Hindi

 

PYTHON HANDWRITTEN NOTES (Chapter 3: Language Components):

reload ! diplomawale.in
Language Components In Python


One Shot/Quick Revision Of Python Language Components:

What Is PYTHON?

Python provides us the feature to execute the Python statements one by one at the interactive prompt. It is preferable in the case where we are concerned about the output of each line of our Python program.
Python was created/developed by Guido van Rossum and first released in 1991. It is an interpreted, high-level, general-purpose programming language.
Guido van Rossum is also known as the father of the PYTHON Programming language.

The if Statement:

The if statement is used to test a particular condition and if the condition is true, it executes a block of code known as if-block. The condition of an if statement can be any valid logical expression that can be either evaluated as true or false.

        SYNTAX: 
                          
                        
    if condition:
    # Code to execute if the condition is true

      EXAMPLE: 
                             
                            a=45
                            if(a<3):
                                print("the value of a is greater than 3")
                            if(a>13):
                                print("the value of a is greater than 13")
                            if(a>7):
                                print("the value of a is greater than 7")
                            else:
                                print("the value of a is not greater than 7")

Python Operator:

An operator is nothing, it's a symbol that's used for some operation in code. operator being performed as a process between two operands. Operators have many types but here we discuss some operators that are used in Python programming language.
Basically, in all scripting languages, we use operators for performing some operations on variables.

Logical Operator:

A logical operator is used for selecting any condition between two conditional statements.

reload | diplomawale.in
Logical Operator

Relational Operator:

Relational operators are also known as comparison operators. These operators are used for comparing the values. It either returns True or False according to the condition. 

sorry! please reload | diplomawale.in
Relational Operator

Bitwise Operator:

First Of all, we have to know Python Bitwise operator word only on integers. In Python, bitwise operators are used to perform bitwise calculations on integers. The integers are first converted into binary and then operations are performed on each bit or corresponding pair of bits, hence the name bitwise operators. The result is then returned in decimal format.

The for Loop:

For loop is a looping statement. In Python, a for loop is a control structure that allows you to execute a block of code repeatedly for a specific number of times or over elements of a sequence (such as a list, tuple, string, or range). It automates the process of performing the same set of actions on different items, simplifying tasks that involve repetition.

for loop | diplomawale.in

for loop



The while loop:

while loop is a looping statement. Python is another type of loop that allows you to repeatedly execute a block of code as long as a specified condition remains true. It's particularly useful when you want to repeat a certain action until a certain condition is met. The loop will continue to execute as long as the condition evaluates to True, and it will stop as soon as the condition becomes False.

while loop | diplomawale.in
while loop

Loop Control Statements:

In Python "Loop control statements' are commands that allow you to alter the behavior of loops. They help you control the flow of execution within loops, enabling you to modify the default behavior of loops like "for" and "while" loops. There are three main loop control statements in Python: break, continue, and pass.

Break Statement:

The break statement is used to abruptly terminate the loop and exit its current iteration, regardless of whether the loop condition is still true. It's commonly used when a certain condition is met and you want to stop the loop immediately.

reload | diplomawale.in
Break Statement

Continue Statement:

The continue statement is used to skip the rest of the current iteration of the loop and move on to the next iteration. It's often used when you want to skip certain iterations based on a condition, but you don't want to exit the loop entirely.

Loops\ Looping Statements In Python | diplomawaale.blogspot.com
Continue Statement

Post a Comment

0 Comments