Check Number is Integer or Float in Python

Hi Guy's, Here is the article to check weather any number is integer or float. if a number has non-decimal point then output display , number is integer. if a number is decimal then output display, number is float.
Code Explanation:
Here, i have taken one integer variables n.
n = float (input ('Enter Any Number : ')) : At here " Enter First Number : " that display into output screen.
since here i am using input method so whatever we enter that accept into string and after applying float typecasting that convert 
into float and store value into n.
d = int(n); n is float after applying int typecasting. n convert into integer and store value into d.
if d == n :
d value compare with n, if d == n. print Entered number is integer. if condition false then
else part execute and print "Entered number is Float.

Happy Coding... Thanks.

Previous
Next Post »