\documentclass{article}

\usepackage{amsmath}
\usepackage{listings}
\usepackage{framed}
\usepackage{amssymb}
\usepackage{graphicx}

\addtolength{\textwidth}{1in}
\addtolength{\evensidemargin}{-0.5in}
\addtolength{\oddsidemargin}{-0.5in}
\addtolength{\textheight}{1in}
\addtolength{\topmargin}{-0.5in}

\begin{document}

\noindent
\centerline{\Large\bf 22C:16 (CS:1210) Quiz 6}

\medskip

\medskip
\hrule

\medskip
\noindent
You have 20 minutes to complete this quiz.

\noindent
\begin{enumerate}
\item 
Define a function called \texttt{deleteNegatives} that takes a list \texttt{L} of integers as a parameter.
The function is required to remove all the negative integers in \texttt{L}.
It is also required that this function make these list deletions in-place and not return anything. 
Furthermore, it is required that the elements that remain the list appear in the same relative order
as before (i.e., prior to deletion).
For example, if list \texttt{L} equals \texttt{[3, -4, -1, -7, 8]}
then after the function call \texttt{deleteNegatives(L)}, \texttt{L} would equal \texttt{[3, 8]}.

\vspace{3.5in}

\hrule

\newpage

\item 
We want to write a function \texttt{notNeighbors} that
takes two words \texttt{word1} and \texttt{word2} as parameters and 
returns \texttt{True} if \texttt{word2} cannot be obtained from \texttt{word1} by
substituting exactly one letter by another and returns \texttt{False} otherwise.
Here is partial code to do this and you need to complete this code.
Our plan is to count the number of corresponding letters in the two words that are not identical.
If this count is not equal to 1 then the two words are not ``neighbors'' and the function should return \texttt{True}.
The code given below is missing some lines and your task is to supply the missing code and complete the function.
You don't have to check if the words contain non-letters -- assume that they don't.
\begin{framed}
\begin{verbatim}
def notNeighbors(word1, word2):
    if len(word1) != len(word2):
        return True
    
    count = 0
    # Three lines of missing code for scanning the two words 
    # and comparing corresponding letters goes here. 









            
    if count != 1:
        return True
    else:
        return False
\end{verbatim}
\end{framed}

\end{enumerate}

\medskip
\hrule
\end{document}
