What is python?
Python is an object oriented programming language. It is easy to understand and a high level language. Python was developed by “Guido Van Rossum” .
Statements in Python language: like the other languages python also included if statement, while loop, for loop, do while loop, continue statement , pass statement , break statement etc.
Use of python : python is used for web development, software development, system scripting.
Creation of a variable in python: to create a variable python doesn’t have any command.
EXAMPLE for creating a variable :
x = 5
y = "VISHANK"
print(x)
print(y)
Simple example of python program :
x = 4 # x is of type int
x = "Sally" # x is now of type str
print(x)
Operators in python : Python has some operators like the other languages. And these are as follows-
1.) Arithmetic operators : these are the operators by which we can do the arithmetic operations. These operators are –
a.) addition (+)
Example : a+b;
b.) Subtraction : (-)
Example : a-b;
c.) Multiplication: (*)
Example: a*b;
d.) Division (/)
Example : a/b;
e.) Modulus : (%)
Example : a%b;
f.) Exponentiation (**)
Example : a**b;
g.) Floor division (//)
Example : a//b;
2.) Assignment operator: with the use of these operators we can assign the values.
a.) =
Example: x=a;
b.) +=
Example : x=x+a;
c.) -=
Example : x=x-a;
d.) *=
Example : x=x*a;
e.) /=
Example : x=x/a;
f.) %=
x=x%a;
g.) //=
Example : x=x//a;
h.) **=
Example : x=x**a;
i.) &=
Example : x=x&a;
j.) |=
Example : x=x|a;
k.) ^=
Example : x=x^a;
l.) >>=
Example : x=x>>a;
j.) <<=
Example : x=x<<a;
3.) Comparison operator : with the help of these operator we can compare the values.
a.) Equal (==) example: a==b;
b.) Not equal (!=) example: a!=b;
c.) Greater then (>) example: a>b;
d.) Less then (<) example: a<b;
e.) Greater then or equals to (>=) example : a>=b;
f.) Less then or equals to (<=) example : a<=b;
4.) Logical operators : are the operators which help to combine the conditional statement.
a.) And : it returns true if both conditions are true.
Example: x>a and x<b;
b.) OR : it returns true if one of the statement is true.
Example : x>a or x<b;
c.) Not : it reverse the result.
Example : x>a not x<b;
5.) Identity operators: these operators are used to compare the object. If they have the same object.
a.) Is : it returns true if both variables have the same object.
Example : x is y;
b.) Is not : if both variable have the same object.
Example : x is not y;
6.) Membership operator : are the operators tests if a sequence presented in an object.
a.) In : Example: a in b;
b.) Not in : a not in b;
7.) Bitwise operators : are used to compare binary numbers.
These are as follows
AND,OR,XOR ,NOT,Zero fill left shift, and Signed right shift.
You provide the concept is very different and useful. Thank you for sharing with us and continuing the great blogging.
ReplyDeleteUnix Training in Chennai
Unix shell scripting Training in Chennai
Excel Training in Chennai
Corporate Training in Chennai
Oracle Training in Chennai
Oracle DBA Training in Chennai
Pega Training in Chennai
Unix Training in Chennai
Unix shell scripting Training in Chennai
Amazing Article ! I have bookmarked this article page as i received good information from this. All the best for the upcoming articles. I will be waiting for your new articles. Thank You !
ReplyDeleteDigital Marketing Training in Chennai
Digital Marketing Course in Chennai