title: Code not executing after a for loop with if and else clauses inside
body: <p>Tried to look for other similar questions but couldn't so here we go.</p>
  <p>I'm building a desktop app using a GUI library on python called tkinter. The following is one of the functions inside the code that loads a complete frame (which is kind of like a page of the app) after a button is pressed. It just takes a tuple called pom and (with the for loop) displays the information in it on the frame, while it allows user to edit a few values on it through input entries.</p>
  <p>I wanted to make a save button that would call an outside function giving it the new edited tuple so I could go on with execution but for some reason I'm not able to make any code after the for loop work.</p>
  <p>I wanted to know why. I'm already one hour in and would keep trying until find out what the hell with this thing. Thank you in advance.</p>
  <pre><code> def edit_pom(pom):
      #Edit frame set up.
      editFrame.tkraise()
      IdLabel = tk.Label(editFrame, text=str(&quot;Editing &quot;+str(pom[-1])), bg=FRAME_BG_COLOR, font=(FONT, 28), fg=&quot;white&quot;)
      IdLabel.place(relx=1/2, rely=1/45, relwidth=1, anchor=&quot;n&quot;)
  
      dataFrame = tk.Frame(editFrame, bg=FRAME_BG_COLOR)
      dataFrame.place(relx=1/2, rely=(1/20)+(1/6), width=WIDTH, relheight=1/2, anchor=&quot;n&quot;)
  
      titles = [&quot;dummy&quot;,&quot;Time&quot;,&quot;Date&quot;,&quot;Description&quot;,&quot;Code&quot;,&quot;Minutes&quot;]
      entries = []
  
  
      index = 1
      for i in pom:
          label1 = tk.Label(dataFrame, text=titles[index]+&quot;:&quot;, bg=FRAME_BG_COLOR, font=(FONT, 18), fg=&quot;white&quot;)
          label1.grid(row=index, column=0, sticky=&quot;W&quot;)
  
          if titles[index] == &quot;Code&quot; or titles[index] == &quot;Description&quot;:
              Entry1 = tk.Entry(dataFrame)
              Entry1.grid(row=index, column=1, sticky=&quot;E&quot;)
              Entry1.insert(0, i)
              entries.append(Entry1)
  
          else:
              label2 = tk.Label(dataFrame, text=i, bg=FRAME_BG_COLOR, font=(FONT, 18), fg=&quot;white&quot;)
              label2.grid(row=index, column=1, sticky=&quot;E&quot;)
  
              label1.grid_columnconfigure(0, weight=10)
              label2.grid_columnconfigure(1, weight=10)
          
          index += 1
  
      print(&quot;This part is not being printed.&quot;)
  </code></pre>