What are data types ? explain any two data types in python
Answers
Answer:
Basic Data Types in Python
Basic Data Types in PythonIntegers.
Basic Data Types in PythonIntegers.Floating-Point Numbers.
Basic Data Types in PythonIntegers.Floating-Point Numbers.Complex Numbers.
Basic Data Types in PythonIntegers.Floating-Point Numbers.Complex Numbers.Strings. Escape Sequences in Strings. Raw Strings. Triple-Quoted Strings.
Basic Data Types in PythonIntegers.Floating-Point Numbers.Complex Numbers.Strings. Escape Sequences in Strings. Raw Strings. Triple-Quoted Strings.Boolean Type, Boolean Context.
Python Numbers
Python NumbersIntegers, floating point numbers and complex numbers falls under Python numbers category. They are defined as int, float and complex class in Python.
Python NumbersIntegers, floating point numbers and complex numbers falls under Python numbers category. They are defined as int, float and complex class in Python.We can use the type() function to know which class a variable or a value belongs to and the isinstance() function to check if an object belongs to a particular class.
Python NumbersIntegers, floating point numbers and complex numbers falls under Python numbers category. They are defined as int, float and complex class in Python.We can use the type() function to know which class a variable or a value belongs to and the isinstance() function to check if an object belongs to a particular class.a = 5 print(a, "is of type", type(a)) a = 2.0 print(a, "is of type", type(a)) a = 1+2j print(a, "is complex number?", isinstance(1+2j,complex))
Python NumbersIntegers, floating point numbers and complex numbers falls under Python numbers category. They are defined as int, float and complex class in Python.We can use the type() function to know which class a variable or a value belongs to and the isinstance() function to check if an object belongs to a particular class.a = 5 print(a, "is of type", type(a)) a = 2.0 print(a, "is of type", type(a)) a = 1+2j print(a, "is complex number?", isinstance(1+2j,complex)) Python Tuple
Python NumbersIntegers, floating point numbers and complex numbers falls under Python numbers category. They are defined as int, float and complex class in Python.We can use the type() function to know which class a variable or a value belongs to and the isinstance() function to check if an object belongs to a particular class.a = 5 print(a, "is of type", type(a)) a = 2.0 print(a, "is of type", type(a)) a = 1+2j print(a, "is complex number?", isinstance(1+2j,complex)) Python TupleTuple is an ordered sequence of items same as list.The only difference is that tuples are immutable. Tuples once created cannot be modified.
Python NumbersIntegers, floating point numbers and complex numbers falls under Python numbers category. They are defined as int, float and complex class in Python.We can use the type() function to know which class a variable or a value belongs to and the isinstance() function to check if an object belongs to a particular class.a = 5 print(a, "is of type", type(a)) a = 2.0 print(a, "is of type", type(a)) a = 1+2j print(a, "is complex number?", isinstance(1+2j,complex)) Python TupleTuple is an ordered sequence of items same as list.The only difference is that tuples are immutable. Tuples once created cannot be modified.Tuples are used to write-protect data and are usually faster than list as it cannot change dynamically.
Python NumbersIntegers, floating point numbers and complex numbers falls under Python numbers category. They are defined as int, float and complex class in Python.We can use the type() function to know which class a variable or a value belongs to and the isinstance() function to check if an object belongs to a particular class.a = 5 print(a, "is of type", type(a)) a = 2.0 print(a, "is of type", type(a)) a = 1+2j print(a, "is complex number?", isinstance(1+2j,complex)) Python TupleTuple is an ordered sequence of items same as list.The only difference is that tuples are immutable. Tuples once created cannot be modified.Tuples are used to write-protect data and are usually faster than list as it cannot change dynamically.It is defined within parentheses () where items are separated by commas
We can use the slicing operator [] to extract items but we cannot change its value.
Answer:
integer: represents integral numbers (numbers without any fractional part). There are three types of integers in python.
float: represents floating point values (numbers with fractional part). The fractional part of a floating point number may be 0 as well. examples of floating point numbers are 3.14, -48.6,18.0, etc
Explanation:
the photo is answer for what are data types and the written part Is answer for explain any two data types in python