in Python by
What are the built-in type does python provides?

2 Answers

0 votes
There are mutable and Immutable types of Pythons built in types Mutable built-in types




Immutable built-in types



0 votes

Python has following built-in data types:

1) Numbers: Python identifies three types of numbers:

2) Integer: All positive and negative numbers without a fractional part

3) Float: Any real number with floating-point representation

4) Complex numbers: A number with a real and imaginary component represented as x+yj. x and y are floats and j is -1(square root of -1 called an imaginary number)

5) Boolean: The Boolean data type is a data type that has one of two possible values i.e. True or False. Note that ‘T’ and ‘F’ are capital letters.

6) String: A string value is a collection of one or more characters put in single, double or triple quotes.

7) List: A list object is an ordered collection of one or more data items which can be of different types, put in square brackets. A list is mutable and thus can be modified, we can add, edit or delete individual elements in a list.

8) Set: An unordered collection of unique objects enclosed in curly brackets

9) Frozen set: They are like a set but immutable, which means we cannot modify their values once they are created.

10) Dictionary: A dictionary object is unordered in which there is a key associated with each value and we can access each value through its key. A collection of such pairs is enclosed in curly brackets. For example {‘First Name’ : ’Tom’ , ’last name’ : ’Hardy’} Note that Number values, strings, and tuple are immutable while as List or Dictionary object are mutable.

Click here to read more about Python
Click here to read more about Insurance

Related questions

0 votes
asked Dec 14, 2019 in Python by sharadyadav1986
+1 vote
asked Feb 13 in Python by SakshiSharma
0 votes
asked Jan 29, 2020 in Azure by Tate
0 votes
asked Aug 30, 2020 in Python by sharadyadav1986
0 votes
asked Aug 29, 2020 in Python by Robindeniel