title: Code help, how to remove / skip an item in a list?
body: <p>I have a program that reads a txt file with names &quot;surname, first name, Y&quot;. one of the names does not have a &quot;Y&quot; and i want to change the code, instead of saying &quot;did not attend any days&quot; to ignore / remove if from the list and not print anything in the output.</p>
  <pre><code>from time import strftime # import time
  print(&quot;Report date: &quot; + strftime(&quot;%d/%m/%Y&quot;)) #Prints clock time
  
  with open(&quot;confPack.txt&quot;, &quot;r&quot;) as confPack: # open file as confpack
      cPack = confPack.read().splitlines() # create cpak variable
  
  with open(&quot;employees.txt&quot;) as fp: #open file as fp
      for line in fp:
          Name = line.strip().split(&quot;,&quot;) # iterate through employees, strip, split and list
          surname = Name[0]
          firstName = Name[1]
          # is the last value not a Y (meaning no Y's)
          if Name[-1] != 'Y':
              packs = 'did not attend any days'
          # if that's false, meaning there is a Y, is the one before it a Y too
          elif Name[-2] == 'Y':
              packs = (cPack[1]) # they get bonus pack
          # if the first 2 conditions are not met
          else:
              packs = (cPack[0]) #they get conference pack
          print(f&quot;Attendee: {surname}, {firstName}: {packs}&quot;) #print surname, first name and pack using f-string
  </code></pre>
  <p>thanks in advance</p>