How do I Strip leading and trailing zeros from string in python?
password = '1234' print(password == ' 1234 ') print(password == ' 1234 '.strip())
Strip provides many trimming features like specifying what characters need to be trimmed. By default spaces but for example ' \t\r\n' can be passed as argument.
Link to documentation or other source
03 Jun 2019
Author: Max Zorin
This example has been recommended 1 times.
Would you recommend this example to your colleagues?