Python Data types:
All data values in Python are objects and each object or value has type. Python has Built-in or Fundamental data types such as Number, String, Boolean, tuples, lists and dictionaries.
Number Data type:
The built – in number objects in Python supports integers, floating point numbers and complex numbers.
Integer Data can be decimal, octal or hexadecimal. Octal integer use O (both upper and lower case) to denote octal digits and hexadecimal integer use OX (both upper and lower case) and L (only upper case) to denote long integer.
Example:
102, 4567, 567 # Decimal integers
0102, o876, 0432 # Octal integers
0X102, oX876, 0X432 # Hexadecimal integers
34L, 523L # Long decimal integers
A floating point data is represented by a sequence of decimal digits that includes a decimal point. An Exponent data contains decimal digit part, decimal point, exponent part followed by one or more digits.
Example :
123.34, 456.23, 156.23 # Floating point data
12.E04, 24.e04 # Exponent data
Complex number is made up of two floating point values, one each for the real and imaginary parts.
Boolean Data type:
A Boolean data can have any of the two values: True or False.
Example:
Bool_varl = True
Bool_var2 = False
String Data type:
String data can be enclosed with single quote or double quote or triple quote.
Example:
Char_data = ‘A’
String_data = “Computer Science”
Multiline_data= “““String data can be enclosed with single quote or double quote or triple quote."""