Google News
logo
Python - Interview Questions
What are the supported data types in Python?
Python has five standard data types :

Numbers : Python supports both integers and floating point numbers. There’s no type declaration to distinguish them; Python tells them apart by the presence or absence of a decimal point.
String : String is a sequence of characters. Python supports unicode characters. Generally strings are represented by either single or double quotes.
List : List is a versatile data type exclusive in Python. In a sense it is same as array in C/C++. But interesting thing about list in Python is it can simultaneously 

hold different type of data.
Tuple : Tuple is another data type which is a sequence of data similar to list. But it is immutable. That means data in a tuple is write protected. Data in a tuple is  written using parenthesis and commas.
Set : Set is an unordered collection of unique items. Set is defined by values separated by comma inside braces { }. Items in a set are not ordered.
Dictionary : Python Dictionary is an unordered sequence of data of key-value pair form. It is similar to the hash table type. Dictionaries are written within curly braces in the form key:value.
Advertisement