Posts

Showing posts with the label Data Types

Python Data Types - int

Image
           To store numerical values, we have 3 data types in python out of which we are going to see int i.e., integer data type here.   Keyword:  int   Numeric value without any fractional part in it can be consider as number with int data type. For example: 0, 55, -32, 8694848, 100 these are numbers with int data type.   1.32, 5.3, 0.4 such numbers cannot be considered as int type.   To initialize a variable with int value we can just write variable name equal to sign (=) and then integer value. e.g. ball_count= 554 distance_travelled= 98   Note: Like other programming languages we don’t have to mention data type keywords before variable name in initialisation. And also, we do not have to declare a variable separately in python.     There are 4 forms in which we can represent an integer value in python. 1.       Decimal Form (base -10) 2.      Binary Form (base-2) 3. ...

Python Data Types - Overview

The python language supports vast number of data Operations. To learn all these important and dynamic range of features we must learn all of its inbuilt data types. There are some major types of data we know numeric, text, sequential, sets, etc. To handle all these different types of data we have different data types specified in python. 1.     For Numeric type of data, we have a.     int b.     float c.      complex 2.    For text type of data, we have a.     str 3.    For sequences we have a.     list b.     tuple c.      range 4.    For data where mapping is required, we have a.     dict 5.    For Set types, we have a.     set and b.     frozenset 6.    For Boolean values, we have a.     bool 7.    Fo...