Posts

Python Comparison Operators

Image
Python Comparison Operators Comparison operators are used to compare two values. these are easy and simple to understand as they return the  boolean value. i.e. True or false. Comparison operators are also known as the relational operators . Operators Description Syntax == Equal to : True if both operands are equal. a == b != Not equal : True if both operands are unequal. a != b >   Greater than : True if 1 st operand is greater than 2 nd operand. a > b < Less than : True if 1 st operand is less than 2 nd operand. a < b >= Greater than or equal to : True if 1 st operand is greater than or equal to 2 nd  operand. a >= b <= Less than or equal to : True if 1 st operand is less than or equal to 2 nd operand. a <= b ...

Assignment Operators in Python

Image
Assignment Operators in Python   Assignment operators : Assignment operators are used to assign the value to the variable. Operators Description Syntax = Is used to assign value to the variable. a = 5 += Add left operand to right operand and assign value to left operand. b += a -= Subtract right operand from left operand and assign value to left operand. b -= a *= Multiply left operands with right operands and assign value to left operand. b *= a /= Divide left operand by right operand and assign value to left operand. b /= a **= Calculate power of left operand to right operand and assign value to left operand. b **= a //= It perform floor division as it divide left operand by right operand , it return the value of quotient and a...

Arithmetic Operators in Python

Image
  Arithmetic Operators in Python Python programming has collection of operators to perform various operations.an operators is a symbols which operates on value or variables. Arithmetic Operator     : Arithmetic operators are the binary operators. Arithmetic operators are used to perform mathematical operations. Addition , Subtraction ,Multiplication ,Division are the basic operation performed by the arithmetic operators. Operator Name Syntax + Addition : Use to add two operands X + Y - Subtraction: Use to subtracts two operands. X – Y * Multiplication : Use to multiply two operands. X * Y / Division : Use to divide two operands. X / Y % Modulus : Use to returns the value of remainder after dividing two operands. X % Y ** Exponentiation (power) : Use for calculating...

Data Types In Python

Image
    Python Data types Data types is the value which we want to store in variables .In which variable are store in different data types Python provide the type() function to Identify the type of variable .In Python there are some standard data types which are used to define storage method .In Python there is no need to define the type of variable in the statement of variable declaration .when the value is assigned to the variable , the interpreter set the data type of variable. There are five types of data types provide by Python        1. Number    2. String 3. List  4. Tuple          5. Dictionary Number :  Number are used to store numeric value .Number object is generated by Python when a number assigned to a variable. In Python there are four types of numeric data. integer (int) : signed integer such as 5,10,15,etc. long : used for high range value like 1234567890 Float : used for point number such as 1.21,3...

Comments in python

Image
  Comments in python The comments are the statement in the code which are ignored by the python interpreter.  Comments are used to add additional information about the program and the statement to understand by the people. Comment can written anywhere in the program and it is good to write comments in code. The comments in python begin with the # (Hash) character.  Anything written in the # is considered as single line comment in a python.   # This is the comment in python. Types of comment : In python there are two types of comments . 1.Single-line comments. 2. Multi-line comments. Single-line comments : The single line comments start with the # character.it can write inline with code and also in an individual line. Example :  # the print() function use to print message on the screen or output device  print("Comment in the python")  output : Comment in python we see the one more example a=2 # value of a is integer b=2.5 # Value of b is float c= ...

Installation Of Python

Image
                            Installation Of Python Python is a high level programming language. it is an open source, simple and easy to use.    In this installation of python on windows 10 we need to follow some steps.   Python on windows 10 : The latest version of python Python 3.9.1 released on 7th Dec 2020. this version has so many new features and optimizations.this is the first version of python to default to the 64-bit system. Installing Python 3.9.1 on windows 10 : open a web browser (like chrome,firefox,microsoft edge) and go to https://www.python.org/ . and you reach to the offical python page. Now, click on the download python 3.9.1 . now it will start downloading. this is around 27-30 MB in size.if your system have lower version of windows, then click download menu and select the specfic version suitable for your system. Once finish the download then ...