Fill in the blank below to write a one-line function diffs that, when given two
ID: 3679809 • Letter: F
Question
Fill in the blank below to write a one-line function diffs that, when given two lists of the same length, returns a list that describes their differences: That. is. the result, of diffs xs ys should be a list of the form [(n_0, x_0, y_0), (n_1, x_1, y_1),..., (n_k, x_k, y_k)], where a tuple (n, x, y) in the output list indicates that (i) xs and ys differ at location n. (ii) x is the n-the value in xs, and (iii) y is the n-the value in ys. For example, (diffs "foot" "foam") should return You do not need to worry about (or teat) cases where xs and ys have different lengths.Explanation / Answer
(xs!=ys)
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.