[' '' '' '' '' '' '' '' 'self check test your understanding of what we have covered so far by trying the following two exercises use the code belowseen earlier in this subsection word_list ['cat','dog','rabbit'letter_list for a_word in word_listfor a_letter in a_wordletter_list append(a_letterprint(letter_list modify the given code so that the final list only contains single copy of each letter the answer is[' '' '' '' '' '' '' '' '' ' redo the given code using list comprehensions for an extra challengesee if you can figure out how to remove the duplicates the answer is[' '' '' '' '' '' '' '' '' '' '' '' 'exception handling there are two types of errors that typically occur when writing programs the firstknown as syntax errorsimply means that the programmer has made mistake in the structure of statement or expression for exampleit is incorrect to write for statement and forget the colon for in range( syntaxerrorinvalid syntax in this casethe python interpreter has found that it cannot complete the processing of this instruction since it does not conform to the rules of the language syntax errors are usually more frequent when you are first learning language the other type of errorknown as logic errordenotes situation where the program executes but gives the wrong result this can be due to an error in the underlying algorithm or an error in your translation of that algorithm in some caseslogic errors lead to very bad situations such as trying to divide by zero or trying to access an item in list where the index of the item is outside the bounds of the list in this casethe logic error leads to runtime error that causes the program to terminate these types of runtime errors are typically called exceptions introduction