Data types inpython :-
A data type represents the type of data stored
into a variable or memory .
Some of the basic data types are :-
o Numeric type
o Sequences
o Sets
o Dictionary
o boolean
Numeric Data type:-
1. Integer :- Integer are whole numbers without a decimal point.
e.g :- age = 17
X = 49
2. Float :- It represents real numbers with a decimal point .
e.g:- pi = 3.14
y = 7.0
3. Complex :- It represent complex numbers
e.g :- a = 6 + 4j
b = I - 2
5.
Boolean Data Types:-
The Boolean data type is one of the simplest data types in
programming
It contain only two type :-
o True
o False
e.g :-
• is 7 equal to 7 = True
• Is 4 equal to 5 = False
6.
Sequence Data Type:-
1. Strings:-Strings are sequences of Characters enclosed in single ०४
double quote
2. List:-List are ordered collections pair of items enclosed with in a of
square brackets. The items in a list can be same or of different
data types.
eg :-
student_names = ['ankit', 'ram', 'Sono“]
List are mutable ie. we can change the contents of list
after its creation.
7.
3. Tuple:-Tuples areordered collection similar to lists, but they
are immutable i.e. you cannot change the contents after its
creation.
e.g. - Student-scores = (85,92,46)
8.
Dictionary :-
Dictionary :-Dictionary are collection of Key-value pairs.
The Key of a dictionary should be unique and they map to
corresponding value.
eg: - Student-info = $ 1: amit', 2: 'govind' →3:"Ram’)
Set :-
Set :- A set is a collection which is unordered and unindexed.
e.g.- fruit f'apple', 'guava', 'banana'"}