Posts

Logical Operator

Image
LOGICAL OPERATOR IN PYTHON Logical Operator are used to combine conditional statements. Logical operators are used to perform Logical operations. There are Three logical operators in python and operator or operator not operator 1. and operator :- It return True if both statements are true otherwise return false. Example:                    x=5                    y=10                     print(x<y and y>x) Output:True 2 .or operator :- It return True if one of the statements is true. If all statements are false then it return false as output. Example:                    x=5                    y=10                    print(x<y or y<x) Output: True ...

Comparison operator

Image
  In python, Comparison Operators Compare the value of two or more Operands and return the result on the basis of Boolean "True or False". Simply, Comparison Operators are used to compare one value to another.

Arithmetic Operators

Image
Arithmetic Operators are used with numeric values to perform common mathematical calculations. In python, With the help of arithmetic operators we can perform these operations: 1.Addition                       (x+y) 2.Subtraction               (x-y) 3.Multiplication           (x*y) 4.Division                    (x/y) 5.Modulus                       (x%y) 6.Exponentiation         (x**y) 7.Floor Division          (x//y)   Most of the students gets confused with Modulus,Exponentiation and Floor division so please keep it in mind: 1.Modulus return the remainder values. 2.Exponentiation return power value of x.  3.Floor Division  return the values before the floating Point. Hop...

Python Operators

Image
OPERATORS Operators  are Special Symbols or signs that help us to perform Arithmetic or Logical operations. Operators are the constructs which can manipulate the values of Operands  Forexample: x=10 y=15          print(10+15)         print(  X+Y) where, x and y are Operands, + is operator output: 25                25 Operators are used to perform Operations on variables and values. Python divides the operators in the following groups:              Example Using one operator from each group: OUTPUT:

Python DataTypes

Image
 Python store values of different Data Types.  Every data item has its datatype. Data types represents a kind of value which determines what operations can be performed on that data. As you all know that, Python is object oriented programming Language. Data Types are actually classes and variables are instance object of these classes. Data Types defines the type of the variable, whether it is an integer variable, string variable, dictionary variable ...e.t.c.  Python has built-in Data types : 1. Immutable(unchangeable) Data Types: Numeric-Integer(int), Floating point(float), Complex Number(complex) String(str) Tuple(tuple) 2.Mutable (changeable) Data Types: List(list) Dictionary(dict) Set(set) And other build-in Data Types are: 3.Binary Data Types: Bytes(byte) Bytearray(bytearray) MemoryView(memoryview) 4.Boolean Type: Bool(bool)-True/False Program using different Datatypes :