title: How to think using while creating sets (Union, Intersection, Issubset)
body: <p>I'm stuck on a school project:</p>
  <blockquote>
  <p>Create a set that presents the following:</p>
  <p>Result of test in English and Spanish:</p>
  <pre><code>Name       ENG     SP
  Alex       A       A
  Bart       F       A
  Nick       A       A
  Andrea     A       F
  Jeff       A       A
  </code></pre>
  <p>Create a program that shows:</p>
  <ol>
  <li>Number of students that passed English or Spanish.</li>
  <li>Number of students that passed both English and Spanish</li>
  <li>Number of students that didn't pass anything (got an F)</li>
  </ol>
  <p>You're supposed to use</p>
  <pre><code>union, intersection, issubset
  </code></pre>
  <p>to show 1-3. The names of the students shall also be included.</p>
  </blockquote>
  <p>The first thing that I've tried is to create som form of list using for loops.</p>
  <pre><code>from ordered_set import OrderedSet
  
  name = OrderedSet(['Alex', 'Bart', 'Nick', 'Andrea', 'Jeff'])
  eng = OrderedSet(['A', 'F', 'A', 'A', 'A'])
  sp = OrderedSet(['A', 'A', 'A', 'F', 'A'])
  
  
  print('Result of test in English and Spanish:')
  print('Name', '\t', 'ENGLISH', '\t', 'SPANISH')
  
  for n in name:
      for e in eng:
          for s in sp:
              print(n,'\t',e,'\t\t', s)
          break
  </code></pre>
  <p>which gives me the output:</p>
  <pre class="lang-none prettyprint-override"><code>Result of test in English and Spanish:
  Name     ENGLISH     SPANISH
  Alex     A       A
  Alex     A       F
  Bart     A       A
  Bart     A       F
  Nick     A       A
  Nick     A       F
  Andrea   A       A
  Andrea   A       F
  Jeff     A       A
  Jeff     A       F
  </code></pre>
  <p>Is there any way of giving the correct OrderedSets on the right places? Or is it too advanced for the task itself? Should I go with another method and convert to set later when I need to call the functions?</p>
  <p>What do I need to do to make it print this once? I tried the <code>range</code>/<code>len</code> functions.</p>
  <p>I understand the outcome of Union, Intersection and issubset, what they do, just need to be able to put them into the code but I'll get to that once I get some better understanding of how to think.</p>