I am working on pset3 problem 3 and I can't wrap my head around some of the language. Can someone explain to me what n and k are supposed to represent?
Read it again carefully.
That first paragraph is telling you a couple things, mainly about the parameters of the function. The function takes three arguments: tuple1, tuple2, len(str) [a number representing the length of the string]. N is an element of tuple1 for which there is a match in tuple2. The match from tuple2 is called K.
I found it a bit ironic that in this problem set they used such arbitrary names like "n" and "k", when they simultaneously teach us that it's best practice to give everything meaningful names. We're not turning this in to anyone, so why not rename n & k? change n to "matchinTuple1" change k to "matchinTuple2"
Sure, definitely good idea I think they chose n and k as it would be easier for people who dealt with Algebra where they use variables or letters like x, y, z, n , k etc all the time. It's just shorter and easier to pronounce atleast for people who struggle with verbose English language words. However, as you said , at some point, it will get confusing if not for meaningful words.
Join our real-time social learning platform and learn together with your friends!