Something that I was slightly confused about through the week was what the syntax of the set-building functions meant for how the function worked. Using an example function from class:
def q0(S1, S2):
''' (set, set) -> bool
Return whether ...
'''
return not all({x in S2 for x in S1})
I was misreading the actual code; thinking that the x value was first referring to the values in S2 and then comparing them to the values in S1. My mistake was pointed out over piazza, and I realized that it is actually the other way round. It was a small misunderstanding, but the realization is infinitely helpful in figuring out what the function actually does.
No comments:
Post a Comment