Home  >  Article  >  Backend Development  >  What is a Python type function? Type function usage example

What is a Python type function? Type function usage example

乌拉乌拉~
乌拉乌拉~Original
2018-08-18 14:08:467245browse

In today's article, let's learn about python dictionary function. In this article, I will explain Python type function and show its function. Okay, without further ado, let’s get started with the article.

What is the Python type function?

Description

Python Dictionary (Dictionary) type() function returns the input variable Type, if the variable is a dictionary, return the dictionary type.

Syntax

type() method syntax:

type(dict)

Parameters

dict - - dictionary.

Return value

Returns the input variable type.

Python type function usage example

The following example shows how to use the type() function:

#!/usr/bin/python

dict = {'Name': 'Zara', 'Age': 7};
print "Variable Type : %s" %  type (dict)

The output result of the above example is:

Variable Type : <type &#39;dict&#39;>

The above is all the content of this article, the built-in dictionary function type function in Python. I hope what I said and the examples I gave can be helpful to you.

For more related knowledge, please visit the Python tutorial column on the php Chinese website.

The above is the detailed content of What is a Python type function? Type function usage example. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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

Related articles

See more