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 128 views
1 answer 158 views
158 views asked Oct 18, 2020 by avibootz
1 answer 186 views
1 answer 157 views
1 answer 173 views
1 answer 190 views
...