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

2 Answers

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

List

Sets

Dictionaries

Immutable built-in types

Strings

Tuples

Numbers
0 votes
by

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.

Related questions

0 votes
asked Jun 12, 2020 in Python by Robindeniel
+1 vote
asked Jan 30, 2022 in Python by sharadyadav1986
...