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 211 views
1 answer 259 views
259 views asked Oct 18, 2020 by avibootz
1 answer 272 views
1 answer 246 views
1 answer 266 views
1 answer 279 views
...