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 |
What is the use of assertions in python?
Explain how Python is an interpreted language
Difference between python list comprehension vs. Map?
Explain Inheritance in Python?
Why numpy is used in python?
What is the length of your largest python code? Can you please describe the project?
What is python unit test?
What does ** (double star/asterisk) and * (star/asterisk) do for parameters?
Can I create a website with Python?
What is map, filter and reduce in python?
How will you compare two lists?
What are some common uses of Pickling in Python?