Scroll Down to See All▾
absaiterallanextanyasciibinboolbreakpointbytearraybytescallablechrclassmethodcompilecomplexdelattrdictdivmodenumerateevalexecfilterfloatformatfrozensetgetattrglobalshasattrhashhelphexidinputintisinstanceissubclassiterlenlistlocalsmapmaxmemoryviewminnextobjectoctopenordpowprintpropertyrangereprreversedroundsetsetattrslicesortedstaticmethodsumsupertupletypevarszip__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: str
Description
Returns a string version of object.
Extended Description
The str() function returns a string representation of an object. If the object has a __str__() method, it calls that method to obtain the string representation. For strings, str() returns the string itself. When used with no arguments, it returns an empty string. If encoding and/or errors are given, str() is used to decode the object, which must be bytes or bytearray, into a string.
Read More about str from Python Documentation
Function Signature
str(object: Any = '', encoding: Optional[str] = None, errors: Optional[str] = 'strict') -> str
Module: builtins
Class: str
Parameters
Parameter List
- object: Any
- encoding: Optional[str]
- errors: Optional[str]
Return
Returns a string representation of the given object.
Return Type
str
Output
Explanation
These examples show how str() works with different types of objects.