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-
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-
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-
you know guys:
" everything is an object in python"
Nice bro You are doing well don't stop it.
ReplyDeleteMake the date 17th May in your mind as my birthday
ReplyDelete