Programming Pandit

c/c++/c#/Javav/Python


Latest Update

Wednesday, September 9, 2020

Python program to display type casting concept by G Krishna Chauhan

 Source Code



#In this program x and y are string. 

x='18'

y='2.9'


#here we convert string to int 


print("Type of x is :", type(x))

X1=int(x)

print("New Type of x is :", type(X1))


#here we convert string to int 


print("Type of x is :", type(y))

Y1=float(y)

print("New Type of x is :", type(Y1))








No comments:

Post a Comment