python data types

 

PYTHON DATA TYPES



o  Numeric

·      Integer

·      Complex

·      Float

o  Dictionaries 

o  Boolean

o  Sets 

   o Sequence types

·      STRING

·      LIST

·      TUPLE

 

Numbers data types

1.INTEGER

Whole number is integer.

01 2 3 4 5 6 7 8 9..... 

2.FLOAT

float means decimal number.                    

0.24

0.754

3.COMPLEX

complex -(number with alphabets')some complex operations and scientific calculation.

3x+4

2j=8

DICTIONARIES DATA TYPE 

Dictionaries is a kind of hash table type 

      Key                                   Values

Roll number

department

Result

19suca03

BCA

All pass

19suca04

CS

All pass

19suca05

CS.IT

All pass

                                                                        Hash table

In the table one column is related to other column like key word. It is an immutable (can’t to change any values )

It is classified into two elements; key and values. This key and value is called item.

The value in the dictionaries can be any types and the key are number, tuples and strings.

BOOLEANS DATA TYPES

This data types we all are use in our day to day life .If any one ask any questions means we say some answer like yes or no. It also like true or false

Booleans represent one of two value is true or false

Boolean true value is 1 and Boolean false value is 0

SET DATA TYPE

Set is an unordered collection of data type that is iterable (repeatable) , mutable and has no duplicate elements .the order of element in a set is undefined though it may consist of various elements

SEQUENCE DATA TYPES

1.STRINGS

Strings are arrays of bytes representing Unicode characters. A string is a collection of one or more characters put in a single quote, double-quote or triple quote. In python there is no character data type, a character is a string of length one.

2.LISTS

Lists are used to store multiple items in a single variable.

It can mutable(u can change any values)

Example ["apple", "banana", "cherry,...."]

3.TUPLES

tuples are to store list of any kind of value. It is an immutable (can’t to change any values )data type. It is sequence like strings .But string is mutable (can be change the values )

 Example ["apple", "banana", "cherry"]

 

Comments

Post a Comment

Popular Posts