Pages

Subscribe:

Ads 468x60px

Wednesday, December 7, 2022

How to cast a value to a variable in python

In python normally we don't need to specify the data type,if we want to assign a specific data type to a variable we can do so by using the following 

codr: x = str(3) # x will be '3' 
y = int(3) # y will be 3
 z = float(3) # z will be 3.0

No comments:

Post a Comment