Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2026 Crash Course
NEET 2026 Crash Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
7.2k views
in Python - Variables and Operators by (54.9k points)
closed by

Explain data types in python?

1 Answer

+1 vote
by (49.3k points)
selected by
 
Best answer

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."""

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

...