suzuki
0
Q:

int to float python

# Python code to demonstrate Type conversion 
# using int(), float() 
  
# initializing string 
s = "10010"
  
# printing string converting to int base 2 
c = int(s,2) 
print ("After converting to integer base 2 : ", end="") 
print (c) 
  
# printing string converting to float 
e = float(s) 
print ("After converting to float : ", end="") 
print (e) 
1
float('1.234')
1
# convert float to int 

int(2.0) #output :2  
1
a = 5
a = float(a) # int to float
0

New to Communities?

Join the community