Questions

How many Datatypes are there in Python?

We can say Python datatypes are collections of data items that help us classify or categorise data. Every value in Python has a data type, and every data type is a class that stores a variable (object).

In a programming language like Python, there are mainly 4 data types:

  • String – It is a collection of Unicode characters (letters, numbers and symbols) that we see on a keyboard.
  • Numerical – These data types store numerical values like integers, floating-point numbers and complex numbers.
  • Boolean – A boolean is used when we wish to restrict data to True/False or yes/no options.
  • Sequence types – These help us store ordered collection of similar or different data types. List, string, and tuples are the types of sequence data types.

Apart from the four main data types mentioned above, sets and dictionaries are data types that are unordered and non-indexed. We cannot change any item value after we define it in a dictionary or set. We also cannot access an item using an index value.

Related Questions

Related Topics

Share with friends

Customize your course in 30 seconds

Which class are you in?
5th
6th
7th
8th
9th
10th
11th
12th
Get ready for all-new Live Classes!
Now learn Live with India's best teachers. Join courses with the best schedule and enjoy fun and interactive classes.
tutor
tutor
Ashhar Firdausi
IIT Roorkee
Biology
tutor
tutor
Dr. Nazma Shaik
VTU
Chemistry
tutor
tutor
Gaurav Tiwari
APJAKTU
Physics
Get Started

Leave a Reply

Your email address will not be published. Required fields are marked *

Download the App

Watch lectures, practise questions and take tests on the go.

Customize your course in 30 seconds

No thanks.