[Tutor] overlapping tuples

David L Neil PyTutor at DancesWithMice.info
Fri Mar 6 21:54:19 EST 2020


Am disappointed that we haven't heard-back on this (per request - mine 
of Fri, 28 Feb 2020 20:31:37 +0000 (UTC) )


(I rarely use sets, so this is an example of personal-gain from 
membership - how the list can help even >beginners improve their Python!)

>> Thanks Mats for your inputs.  overlap means if two numbers share across two
>> tuples For Ex  if we take two tuples (1,20) and (15,20)  there is a
>> over lap because 15,6,17,18,19,20  numbers are sharing between these
>> two sets.

Was intrigued by the solution using set-intersection. Neat!
- as long as the 'ranges' are not too large*.
* am not going to try to define "too large". It works!

I suspect that the assignment came too early in the course to expect 
trainees to use set-functionality, but who knows...


During the conversation, noted criticisms of the wording of the 
question, and perhaps of the attempted solution/approach.

In my experience, this could just as possibly be laid at the door of the 
trainer, as the trainee. We've all seen 'academic' questions which 
tersely expect that 'the latest lesson' be applied. Yes, it might have 
been easier if there was some practical context, eg a "time-line", thus: 
were Beethoven and Mozart alive at the same time? This would also have 
helped with the overlap (define as sub-set or intersection?) queries - 
although the example data provided did (appear to!) illustrate.


Am wondering then:

We already have well-worn refrains: requesting the actual code, the full 
trace-back and err.msg, etc. Should we also be asking for/expecting the 
full text/relevant part thereof, of assignments?

(in my courses (not Python!) we already know the trainee's context 
because each session/assignment has its own attached discussion list. 
So, even where the assignment topic develops over successive 
assignments, we avoid confusion)

This would not only facilitate the IT-creator advice (which this thread 
realised in generous quantity), but also give 'us' the opportunity to 
provide feedback to course-leaders/instructional designers who might not 
otherwise become aware of the need to 'improve' the original question...

More generally, such would also help 'us' to readily appreciate if the 
OP needs help with Python code, per-se, or to understand how Python 
fits-together (the 'I'm not helping if I do your homework for you' 
category). Accordingly, to be able to tailor more 'intelligent' responses!


NB there could be a technical issue with the definition and application 
of Copyright, in some jurisdictions - although the same could be said 
about code-snippets which appear on (are volunteered to) such lists 
every day!
-- 
Regards =dn


More information about the Tutor mailing list