Scroll Down to See All▾
absaiterallanextanyasciibinboolbreakpointbytearraybytescallablechrclassmethodcompilecomplexdelattrdictdivmodenumerateevalexecfilterfloatformatfrozensetgetattrglobalshasattrhashhelphexidinputisinstanceissubclassiterlenlistlocalsmapmaxmemoryviewminnextobjectoctopenordpowprintpropertyrangereprreversedroundsetsetattrslicesortedstaticmethodstrsumsupertupletypevarszip__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: int
Description
Converts a number or string to an integer, or return 0 if no arguments are given.
Extended Description
The int() function returns an integer object constructed from a number or string x, or returns 0 if no arguments are given. If x is a number, it can be a plain integer, a float, or a number with a different base. If x is a string, it must be a sequence of digits in the given base (default 10). The optional base parameter specifies the base in which the string is interpreted.
Read More about int from Python Documentation
Function Signature
int(x: Union[str, Number, None] = None, base: Optional[int] = 10) -> int
Module: builtins
Class: int
Parameters
Parameter List
- x: Union[str, Number, None]
- base: Optional[int]
Return
Returns an integer object constructed from the given number or string.
Return Type
int
Output
Explanation
This example shows basic usage of int() with different types of input.