Husna Farsana’s Post

🔷 Python Type Casting | Using type() Function In Python, the type() function is used to check the data type of a variable. Type casting helps us convert one data type into another when needed. 🔹 Example • x = 100 print(type(x)) ▶ Output: <class 'int'> • x = float(100) print(type(x)) ▶ Output: <class 'float'> 🔹 Key Point ✔ type() shows the current data type ✔ float() converts an integer into a decimal value Using type() with type casting helps in writing accurate and flexible programs. #Python #TypeCasting #TypeFunction #ProgrammingBasics #LearningJourney #Upskilling

To view or add a comment, sign in

Explore content categories