How to convert int to float in Python

2 Answers

0 votes
aint = 99
bint = 88

cfloat= float(aint + bint)

print(cfloat)



'''
run:

187.0

'''

 



answered Dec 31, 2020 by avibootz
0 votes
a = 7
print(type(a))

a = float(a)
print(type(a))



'''
run:

<class 'int'>
<class 'float'>

'''

 



answered Dec 31, 2020 by avibootz

Related questions

1 answer 210 views
1 answer 258 views
258 views asked Oct 18, 2020 by avibootz
1 answer 271 views
1 answer 245 views
1 answer 265 views
1 answer 278 views
...