You can use an if statement to check if the length of the string is 1. If it is, you can concatenate a '0' to the beginning of the string using the string concatenation operator '+' or by using the string format method.
Here's an example:
main.py216 chars11 lines
In both cases, the output will be '05' since we added a '0' to the beginning of the string.
gistlibby LogSnag