How are data types defined in python and how much bytes do integer and decimal data types hold?



How are data types defined in python and how much bytes do integer and decimal data types hold?..

Answer / Santosh Singh Dhakariyal

In Python, data types can be either built-in or user-defined. Built-in data types include integers (immutable, any whole number), floats/decimals (immutable, real numbers with a decimal point), strings (immutable, a series of characters enclosed in quotes), lists (mutable, ordered collection of elements), tuples (immutable, ordered collection of elements), dictionaries (mutable, key-value pairs), and booleans (True or False). Integer data type does not have a fixed size and uses as many bytes as required to store the number. Decimal data type can have a variable size depending on precision.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

What is the use of assertions in python?

0 Answers  


Explain how Python is an interpreted language

2 Answers  


Difference between python list comprehension vs. Map?

1 Answers  


Explain Inheritance in Python?

1 Answers  


Why numpy is used in python?

1 Answers  


What is the length of your largest python code? Can you please describe the project?

0 Answers  


What is python unit test?

1 Answers  


What does ** (double star/asterisk) and * (star/asterisk) do for parameters?

1 Answers  


Can I create a website with Python?

1 Answers  


What is map, filter and reduce in python?

1 Answers  


How will you compare two lists?

1 Answers  


What are some common uses of Pickling in Python?

1 Answers  


Categories