Data type

 In Python, there are several built-in data types that you can use to store and manipulate data. Some of the most common data types in Python include:


Integers: These are whole numbers, positive or negative, without any decimal point. For example, 10, -5, and 0 are all integers.   simple number


Floating-point numbers: These are numbers with a decimal point. For example, 3.14, -2.5, and 0.0 are all floating-point numbers.  decimal number


Strings: These are sequences of characters, such as words or phrases. Strings are usually enclosed in single or double quotes. For example, "hello", 'world', and "123" are all strings.   ""


Booleans: These represent True or False values. For example, True and False are both booleans.  


Lists: These are ordered collections of values that can be of any data type. Lists are written as a sequence of values, separated by commas, and enclosed in square brackets. For example, [1, 2, 3] is a list of integers, and ['a', 'b', 'c'] is a list of strings.     [ ]


Tuples: These are similar to lists, but they are immutable, meaning that they cannot be modified once created. Tuples are written as a sequence of values, separated by commas, and enclosed in parentheses. For example, (1, 2, 3) is a tuple of integers, and ('a', 'b', 'c') is a tuple of strings.   ( )


Dictionaries: These are unordered collections of key-value pairs. Dictionaries are written as a sequence of key-value pairs, separated by commas, and enclosed in curly braces. The keys in a dictionary must be unique, and they are used to access the corresponding values. For example, {'a': 1, 'b': 2, 'c': 3} is a dictionary with three key-value pairs.   { }


There are also several other data types in Python, such as sets, frozen sets, and objects, but these are less commonly used.

https://mackupdroduct.blogspot.com/





Comments