Computer Science, asked by mushtaqnajar8153, 11 months ago

Write the output of the following code
# !/usr/bin/python
str = "this is string example….wow!!!"
print str.zfill(40)
print str.zfill(50)

Answers

Answered by Anonymous
0

The given code uses the method of Zfill pads.

  • The method of Zfil pads string on the left with the zeros to fill the width.
  • The syntax for the same is str.zfill ( width). This method returns a padded string
  • On running the above code, the following result will be produced -

       OOOOOOOOthis is string example….wow!!!

       000000000000000000 this is string example…. wow!!!

Similar questions