Skip to content

This Repository is a collection of different ethical hacking tools and malware's for penetration testing and research purpose written in python, ruby, rust, c++, go and c.

1.0 KB
Raw Blame

title: Python type() built-in function - Python Cheatsheet description: With one argument, return the type of an object. The return value is a type object and generally the same object as returned by object.class.

Python type() built-in function From the Python 3 documentation With one argument, return the type of an object. The return value is a type object and generally the same object as returned by object.__class__.

Examples

>>> type('span')
# <class 'str'>

>>> type(99)
# <class 'int'>

>>> type(1.1)
# <class 'float'>

>>> type([1, 2])
# <class 'list'>

>>> type((1, 2))
# <class 'tuple'>

>>> type({1, 2})
# <class 'set'>

>>> type({'a': 1, 'b': 2})
# <class 'dict'>