Casting data type in python

Casting data type in python

Instructor-svgAl-Mamun Sarkar
Mar 24 , 2020

Casting data type in python. The following code shows how to cast data type in python.

Code:

a = 12.23
x = str(a)
print(type(x))

x = int(a)
print(type(x))

x = int(a)
print(type(x))

x = int(input())
print(type(x))

 

  • Share On:
  • fb
  • twitter
  • pinterest
  • instagram