files we read the file name from the user and place it in variable named fname and open that file now we can run the program repeatedly on different files python search py enter the file namembox txt there were subject lines in mbox txt python search py enter the file namembox-short txt there were subject lines in mbox-short txt before peeking at the next sectiontake look at the above program and ask yourself"what could go possibly wrong here?or "what might our friendly user do that would cause our nice little program to ungracefully exit with tracebackmaking us look not-so-cool in the eyes of our users? using tryexceptand open told you not to peek this is your last chance what if our user types something that is not file namepython search py enter the file namemissing txt traceback (most recent call last)file "search py"line in fhand open(fnamefilenotfounderror[errno no such file or directory'missing txtpython search py enter the file namena na boo boo traceback (most recent call last)file "search py"line in fhand open(fnamefilenotfounderror[errno no such file or directory'na na boo boodo not laugh users will eventually do every possible thing they can do to break your programseither on purpose or with malicious intent as matter of factan important part of any software development team is person or group called quality assurance (or qa for shortwhose very job it is to do the craziest things possible in an attempt to break the software that the programmer has created the qa team is responsible for finding the flaws in programs before we have delivered the program to the end users who may be purchasing the software or paying our salary to write the software so the qa team is the programmer' best friend so now that we see the flaw in the programwe can elegantly fix it using the try/except structure we need to assume that the open call might fail and add recovery code when the open fails as follows