Day #4 - variables and Data Types

                  Variables --


variables are like containers just like you have in your kitchen  in which you store lentils , flour & rice etc. 

in python programming language 'variables' are just like those containers.

that you people make containers and store data in them. and this data

is stored in the memory.it is stored in it, what you call 'RAM'

  Program--






what is data types--

"data type specifies the types of value a variables holds. this is required in programming to do various operations without causing an error.

just like a container can contain 'Liquid' 'Solid' 'Lentils' or 'Sugar'

just like that there are 'type' in python which we refer as 'data types'


output-

    


1. Numeric data: int,  float, complex

  • int:  7, -5 ,0
  • float: 7.345, -5.0, 0.00001
  • complex: 6+2i
2. text data: str
   str: "hello world!", "python programming"

3. Boolean data:
  Boolean data consists of values True of False.

4. Sequenced data: list, Tuple
list: a list is an collection of data with elements separated by a comma and enclosed within square brackets. list are mutable and can be modified after creation.
input-

output-



Tuples:
                    a tuple is an ordered collection of data with elements separated by a comma and enclosed within parentheses. tuples are immutable and can not be modified after creation.

input-


output-




5.Mapped data: dict

 dict:   A dictionary is an unordered collection of data containing a key:
value pair. the key: value pairs are enclosed within curly brackets.

input-


output-



you know guys:

" everything is an object in python"




Comments

  1. Nice bro You are doing well don't stop it.

    ReplyDelete
  2. Make the date 17th May in your mind as my birthday

    ReplyDelete

Post a Comment

Popular posts from this blog

day #6 - Exercise 1: make two Calculator using in python

day #5 - Operators in python