strings while trueline input(''if line[ ='#'continue if line ='done'break print(lineprint('done!'codelook what happens when the user enters an empty line of inputhello there hello there don' print this print thisprint thistraceback (most recent call last)file "copytildone py"line in if line[ ='#'indexerrorstring index out of range the code works fine until it is presented an empty line then there is no zero-th characterso we get traceback there are two solutions to this to make line three "safeeven if the line is empty one possibility is to simply use the startswith method which returns false if the string is empty if line startswith('#')another way is to safely write the if statement using the guardian pattern and make sure the second logical expression is evaluated only where there is at least one character in the string if len(line and line[ ='#' glossary counter variable used to count somethingusually initialized to zero and then incremented empty string string with no characters and length represented by two quotation marks format operator an operator%that takes format string and tuple and generates string that includes the elements of the tuple formatted as specified by the format string