0

Integer checking

I have a = float(input()) How can I check if a is an integer ? Thank you

12th Feb 2021, 7:48 PM
Ngoc Tuan
Ngoc Tuan - avatar
4 Respuestas
+ 4
if a.is_integer(): ...
12th Feb 2021, 7:50 PM
visph
visph - avatar
+ 1
yes, why not?
13th Feb 2021, 1:35 AM
visph
visph - avatar
0
visph wow, it is that simple, thank you so much
12th Feb 2021, 7:59 PM
Ngoc Tuan
Ngoc Tuan - avatar
0
visph but can I add it in a function
13th Feb 2021, 1:34 AM
Ngoc Tuan
Ngoc Tuan - avatar