A Tip A Day – Python Tips #12: Using zfill() for ‘0’ padding
zfill() function is type of padding function. This function fills only with '0'. Takes the resultant width of the string as argument. This is useful to pad a numeric string values.
There may be situations, where we may need to dynamically place a value in a sub string of a string. You may think it is easy that we can concatenate strings. For example: “The patient name is ” + patient_name…
In our previous post A Tip A Day – Python Tip #7: OpenCV – CV2: imread() and resize(), we have explored a simple image and its pixel values. Why divide image by 255? The pixel values can range from 0…