To see the different kinds of data types in python.
It stores numeric values.
It stores the decimal point values.
String is set of characters represented in single quotation.
String is set of characters represented in single quotation.
List is a collection of elements,which is ordered and changeable.
Python lists are written with square brackets[].
Tuples is a collection of elements,which is ordered and unchangeable.
Python tuples are written with round brackets.()
Set is a collection which is unordered and unindexed.
Python sets are written with curly brackets.{}
It used to store key:value pair of data.
Key may be a string
#integer type
salary=10000
#float type
rating=5.4
#single quoted string
string1=’sathish’
#double quoted string
string2=”kumar”
#python list
list1=[‘sathish’,’sangeetha’,’venkat’,’sheela
‘,’sudhakar’,23,24,25,22,21]
#python tuple
tuple1=(‘sathish’,’sangeetha’,’venkat’,
‘sheela’,’sudhakar’,
23,24,25,22,21)
#python set
set1={‘sathish’,’sangeetha’,’venkat’,
‘sheela’,’sudhakar’,23,24,25,22,21}
#python dictionary
dict1={‘sathish’:23,’sangeetha’:22,
‘venkat’:24,’sheela’:26,’sudhakar’:25}
#print the types of data types.
print(type(salary))
print(type(rating))
print(type(string1))
print(type(string2))
print(type(list1))
print(type(tuple1))
print(type(set1))
print(type(dict1))