Posts

Showing posts from July, 2026

Python DataType

                                        python datatype  In Python, data types define the kind of value a variable store, such as numbers, text, or collections. 1. Numeric Data Types a = 10          # int (Integer) b = 10.5        # float (Decimal) c = 3 + 4j      # complex (Complex number) Example: print(type(a)) print(type(b)) print(type(c)) Output: <class 'int'> <class 'float'> <class 'complex'> 2. String ( str ) A string is a sequence of characters. name = "Ram" city = 'Mumbai' print(name) print(type(name)) Output:- Ram <class 'str'> 3. Boolean ( bool ) Stores either True or False . is_student = True is_working = False 4. List ( list ) An ordered, mutable collection. You can add, remove, or change items. fruits = ["Apple", "Banana", "Mango"] fruits.append("Orange") print(fruits) 5. Tuple ( t...