Python's function Usage isinstance ()

Source: Internet
Author: User

#-*-coding:utf-8-*-#python#Xiaodeng#python's function Usage isinstance ()#isinstance ()#Description: Returns a Boolean value that determines the data type" "isinstance (...) Isinstance (object, class-or-type-or-tuple), BOOL object: An object Class-or-type-or-tuple: Class/base type/tuple, can pass only one data type, or you can    Pass multiple data types bool: Returns a Boolean value of return whether an object was an instance of a class or of a subclass thereof.    With a type as second argument, return whether this is the object ' s type. The form using a tuple, isinstance (x, (A, B, ...)), is a shortcut for isinstance (x, a) or isinstance (x, B) or ... (etc.)." "#CaseObject=range (5)#ListPrintIsinstance (Object,tuple)#FalsePrintIsinstance (Object,list)#TrueObject='Xiaodeng'PrintIsinstance (object, (Str,int))#True, passing multiple data types at the same timePrintIsinstance (object, (Str,int,list))#True, passing multiple data types at the same time

Python's function Usage isinstance ()

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.