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.

1019 B
Raw Blame

title: Python tuple() built-in function - Python Cheatsheet description: Rather than being a function, tuple is actually an immutable sequence type, as documented in Tuples and Sequence Types — list, tuple, range.

Python tuple() built-in function From the Python 3 documentation Rather than being a function, tuple is actually an immutable sequence type, as documented in Tuples and Sequence Types — list, tuple, range.

Examples

>>> t = tuple()
>>> type(t)
# <class 'tuple'>
>>> t
# ()

>>> l = [1, 2, 3]
>>> tuple(l)
# (1, 2, 3)