Data Types on Python

 TYPES OF DATA TYPES 

 Text type 

 Numeric Types 

 Sequence Types 

 Mapping Type 

 Set Types 

 Boolean Type 

 Binary Types

NUMBERS 

 Int 

 Float 

 complex

TYPE CONVERSION 

 Converting from one form of number to other.

STRINGS 

 A string is a collection of characters with both integers and alphabets.

CASTING 

 Converting from one data type format to other.

BOOLEAN 

 Consists of True and False basically 1 and 0


COLLECTION DATA TYPES IN PYTHON

  List 

 Tuple 

 Set 

 Dictionary

LIST 

 List is a collection which is ordered and changeable. 

 Allows Duplicate Members. 

 Square Brackets 

 Example:- this_is_list = [“America”,”Barcelona”,”China”]

TUPLE

 Tuple is a collection which is ordered and unchangeable 

 Allows duplicate members. 

 Uses Round Brackets 

 Example:- this_is_tuple = (“America”,”Barcelona”,”China”)

SET 

 Set is a collection which is unordered and unindexed. 

 No duplicate members. 

 Uses curly brackets. 

 Example:- This_is_set = {“America”,”Barcelona”,”China”}

DICTIONARY 

 Dicationary is a collection which is unordered, changeable and indexed. 

 No duplicate members. 

 Dictionaries use curly brackets and they have keys and values. 

 Example:- this_is_dict = {

                                                “city” : “Rome”, 

                                                ”Country”: “Italy”

                                            }

RANGE 

 Range is a built in function used in python to generate a sequence of numbers.

ARRAYS 

 Python does not have a built in support for Arrays. 

 Python Lists can be used as arrays.


SYNTAX

 Set of rules that defines the combinations of symbols that considered to be correctly structured statements.

VARIABLES 

 Variables are used to store information to be referenced or manipulated in a computer program.

COMMENTING

 Way of making certain lines of program not executable. 
 Used for storing important information about a program to be conveyed to the fellow developers.

KEY WORDS

 These are certain words that have pre defined operations assigned to it.  These keywords cannot be used as variable names.


INPUT 

 Used to get input from an user. 
 The input can be of any means and of any type like integer , float, string etc.




Post a Comment (0)
Previous Post Next Post