Sociology, asked by 20100381110271, 5 months ago

write down all the data types in python​?

Answers

Answered by preethi123431
2

Explanation:

Python Data Types

Data types are the classification or categorization of data items. Data types represent a kind of value which determines what operations can be performed on that data. Numeric, non-numeric and Boolean (true/false) data are the most used data types. However, each programming language has its own classification largely reflecting its programming philosophy.

Python has the following standard or built-in data types:

Numeric

1. A numeric value is any representation of data which has a numeric value. Python identifies three types of numbers:

2. Integer: Positive or negative whole numbers (without a fractional part)

3. Float: Any real number with a floating point representation in which a fractional component is denoted by a decimal symbol or scientific notation

Complex number: 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)

Boolean

Data with one of two built-in values True or False. Notice that 'T' and 'F' are capital. true and false are not valid booleans and Python will throw an error for them.

Sequence Type

A sequence is an ordered collection of similar or different data types. Python has the following built-in sequence data types:

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

List : A list object is an ordered collection of one or more data items, not necessarily of the same type, put in square brackets.

Tuple: A Tuple object is an ordered collection of one or more data items, not necessarily of the same type, put in parentheses.

Dictionary

A dictionary object is an unordered collection of data in a key:value pair form. A collection of such pairs is enclosed in curly brackets. For example: {1:"Steve", 2:"Bill", 3:"Ram", 4: "Farha"}

Similar questions