title: Wanting 1 output vs multiple in loops
body: <p>I am writing a function that takes a 'major' and iterates it through the values in the dictionary. The correct output is if the major is in the value print the key (1 instance) and if it is not just print the 'major' as upper(). But I cannot figure out how to write it as such that it checks each value, but only prints one instance of the key if the value is in it, and not multiple uppercase formats for the other 16 values.</p>
  <p><strong>Input:</strong>
  education,
  comp sci</p>
  <p><strong>Output:</strong>
  EDUCATION,
  COMP</p>
  <pre><code>student_majors_vari = {
  'COMP':['compsci','comp sci','computer sci','computer science'],
  'CMPE':['compeng', 'comp eng', 'computer eng', 'computer engineering'],
  'EE':['eleceng', 'elec eng', 'elec engineering', 'electrical engineering'],
  'MATH':['mathsci', 'math sci', 'mathematical sci', 'mathmatical sciences', 'mathematics']
  }
  
  def get_major_code(major):
    for univ_majors in student_majors_vari:
      values = student_majors_vari[univ_majors]
      for v in values:
          if major == v or major == values:
              print(univ_majors)
          else:
              print(major.upper())
  </code></pre>