title: What can be the solution to the error mentioned below?
body: <p>I am accessing the record list in function submit from the result function but it is giving an error. I have mentioned the error. I have also tried to make a record list global but it is still giving me an error. Anyone can help?
  It is the sample code. I am using the same logic in a project which has a requirement to access the record list in submit function from the result function.
  Is there anyone who can suggest some appropriate solution to this error?</p>
  <pre><code>def submit():
      for i in record:
          for j in i:
              if(j=='bread'):
                  p=int(i[1]) * 3
      print(p)
  def result():
      global record
      record=[('bread','50'),('cake','200'),('cold drink','20')]
  a=sumbmit()
  
  ###ERROR###
      for i in record:
  NameError: name 'record' is not defined'''
  </code></pre>