How to determine whether python is a floating point number

爱喝马黛茶的安东尼
Release: 2019-06-19 13:31:07
Original
21234 people have browsed it

How to determine whether python is a floating point number

#How does python determine whether it is a floating point number? The specific method is as follows:

isinstance() function

can be used to determine the type of a variable. It returns a Boolean value, False or True.

Like int, float, etc. are all basic variable types. In fact, classes are also a type of variables.

i=9,j=1.3
>>isinstance(i,float)
>>False
>>isinstance(j,float)
>>True
Copy after login

The above is the detailed content of How to determine whether python is a floating point number. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template