Tuesday, May 2, 2017

Patching 0 for a variable in python

As part of a program logic, i need to patch 0 for a variable to make sure the total length of the string is 3.

Here the variable name is shivin

shivin = shivin.zfill(3)
return shivin

No comments:

Post a Comment