MENU
Question -

Name four PythonтАЩs basic data types. Why are they called so ?



Answer -

The four basic data types are :
1. Number
2. Sequences
3. Sets
4. Maps.
These are called so because :
1. Number data type stores numerical values and is immutable i.e., value of its object cannot be changed.
These are of 3 types :
1. Integer and Long
2. Float/Floatingpoint
3. Complex
2. Sequence is an ordered collection of items, indexed by positive integers, It is a combination of mutable and non-mutable data types. Three types of sequence data type available in Phyton are strings, lists and tuples.
3. Sets in an unordered collection of values of any type, with no duplicate entry. Sets are immutable. Example S = Set ([1,2,3,4])
4. Mapping data types are unordered and mutable. Dictonaries falls under mapping.
Example
d = {1 : тАШaтАЩ, 2 : TbтАЩ, 3 : тАШcтАЩ

Comment(S)

Show all Coment

Leave a Comment

Free - Previous Years Question Papers
Any questions? Ask us!
×