Scroll Down to See All▾
absaiterallanextanyasciibinboolbreakpointbytearraybytescallablechrclassmethodcompilecomplexdelattrdictdivmodenumerateevalexecfilterfloatformatfrozensetgetattrglobalshasattrhashhelphexidinputintisinstanceissubclassiterlenlistlocalsmapmaxmemoryviewminnextobjectoctopenordpowprintpropertyrangereprreversedroundsetsetattrslicesortedstaticmethodstrsumsupertypevarszip__import__clear_(dict)clear_(list)clear_(set)copy_(dict)copy_(list)copy_(set)fromkeysgetitemskeyspop_(dict)pop_(list)pop_(set)popitemsetdefaultupdatevaluescount_(tuple)count_(list)count_(str)index_(tuple)index_(list)index_(str)adddifferencedifference_updatediscardintersectionintersection_updateisdisjointissubsetissupersetremove_(set)remove_(list)symmetric_differencesymmetric_difference_updateunionupdateclosefilenoflushisattyreadreadablereadlinereadlinesseekseekabletelltruncatewritablewritewritelinesappendextendinsertreversesortcapitalizecasefoldcenterencodeendswithexpandtabsfindformatisalnumisalphaisasciiisdecimalisdigitisidentifierislowerisnumericisprintableisspaceistitleisupperjoinljustlowerlstripmaketranspartitionreplacerfindrindexrjustrpartitionrsplitrstripsplitsplitlinesstartswithstripswapcasetitletranslateupperdirzfillFunction Details: tuple
Description
Returns a tuple whose items are the same and in the same order as iterable's items.
Extended Description
The tuple() function creates a tuple object. Tuples are immutable sequences, typically used to store collections of heterogeneous data. If no argument is given, it returns an empty tuple. If the argument is a sequence (string, list, or tuple), it returns a tuple with the same items in the same order. For any other iterable, it returns a tuple containing the items returned by repeatedly calling the iterable's __next__() method.
Read More about tuple from Python Documentation
Function Signature
tuple(iterable: Optional[Iterable] = None) -> tuple
Module: builtins
Class: tuple
Parameters
Parameter List
- iterable: Optional[Iterable]
Return
Returns a tuple containing items from the given iterable.
Return Type
tuple
Output
Explanation
These examples show how tuple() works with different types of input.