title: Can I run two while loop separately in function? if not how do I verify the list in python?
body: <p>Can I run two while loop separately in function? if not how do I verify the list in python?</p>
  <pre><code>def ADD_RESULT():
  
      while True:
          code = input(&quot;Enter the code&quot;)
          if code in COURSE_CODE :
              print(&quot;Details found&quot;)
              break
          else:
              print(&quot;course  didn't match&quot;)
              continue
      print(&quot;&quot;)
  
      while True:
          sid = input(&quot;Enter student id&quot;)
          if sid in STUDENT_ID:
              print(&quot; found&quot;)
              continue
          else:
              print(&quot; not found&quot;)
              break
  </code></pre>
  <p>How do I use the while loop to verify this above python list?</p>