Python‎ > ‎str‎ > ‎

str.zfill()


Introduction
Return with add 'o' before the string.

Syntax
str.zfill(x)

Parameters
x=number

Examples
The return are:
 >>> "adil".zfill(5)

'0adil'
>>> "adil Waseem".zfill(15)
'0000adil Waseem'

The equal to:
>>> str.zfill("Adil WAseem", 14)
'000Adil WAseem'
>>> str.zfill("Python", 40)
'0000000000000000000000000000000000Python'

type(str.zfill()
The returns is:
 >>> type(x)
<class 'str'>

dir(str.zfill())
The following are functions of str.zfill())
>>> dir(str.zfill)
['__call__', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__get__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__name__', '__ne__', '__new__', '__objclass__', '__qualname__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__text_signature__']
>>> 



Comments