of string within another string and either returns the position of the string or - if the string was not foundwe can write the following loop to show lines which contain the string "@uct ac za( they come from the university of cape town in south africa)fhand open('mbox-short txt'for line in fhandline line rstrip(if line find('@uct ac za'=- continue print(linecodewhich produces the following outputfrom stephen marquard@uct ac za sat jan : : -authentication-warningset sender to stephen marquard@uct ac za using - fromstephen marquard@uct ac za authorstephen marquard@uct ac za from david horwitz@uct ac za fri jan : : -authentication-warningset sender to david horwitz@uct ac za using - fromdavid horwitz@uct ac za authordavid horwitz@uct ac za here we also use the contracted form of the if statement where we put the continue on the same line as the if this contracted form of the if functions the same as if the continue were on the next line and indented letting the user choose the file name we really do not want to have to edit our python code every time we want to process different file it would be more usable to ask the user to enter the file name string each time the program runs so they can use our program on different files without changing the python code this is quite simple to do by reading the file name from the user using input as followsfname input('enter the file name'fhand open(fnamecount for line in fhandif line startswith('subject:')count count print('there were'count'subject lines in'fnamecode