Implicit type conversion in python

PHOTO EMBED

Wed Aug 02 2023 14:58:47 GMT+0000 (Coordinated Universal Time)

Saved by @pythonHub #python #python-hub #basics

num1 = 10 #it is an integer
num2 = 10.1 #it is an float
num3 = num1 + num2 #it will be converted to float to avoid data loss
print(num3) #20.1
print(type(num3)) #it got converted to float datatype
content_copyCOPY