title: Python - Assign one element in list to every element in another list within a loop
body: <p>I´m trying to sort through some files, where i first find the filename in my <code>dir</code> with  <code>glob.glob</code> ex. (filename1, filename2, filename3) so i get this list of files [(Filename1,), (Filename2,), (Filename3,)]</p>
  
  <p>After this i have a for loop that with <code>.readline()</code> extracts a string from each file. So after every loop has ben executed, filename1 prints 10 strings, next loop filename2 prints 3 strings, next loop filename3 prints 5 strings .</p>
  
  <pre><code>loop
  [string1]
  [string2]
  [string3]
  .....
  loop
  [string1]
  [string2]
  [string3]
  ....
  loop
  [string1]
  [string2]
  [string3]
  ....
  </code></pre>
  
  <p>The problem is that i know that the 10 strings came from filename1 but i want to indicate that they did.</p>
  
  <pre><code>    How i would like it to look after print 
  loop
  [filename1 , string1]
  [filename1 , string2]
  [filename1 , string3]
      .......
  new loop   
  [filename2 , string1]
  [filename2 , string2]
  [filename2 , string3]
      .......
  new loop
  [filename3 , string1]
  [filename3 , string2]
  [filename3 , string3]
  </code></pre>
  
  <p>can someone help me or send me in the right direction? i have search for "assigning a list to a element in another list" and similar tags, but can´t find what i need... help is appreciated thanks! </p>
  
  <p>EDIT</p>
  
  <pre><code>    with open (filename) as filesearch:
              filesearch = filesearch.readlines()
  # ---------- Loop 1 for filename and filedate-----------------------------------
      for line in filesearch:
              if createdate in line:  # extract "Create Time"
                  date = []
                  file = []
                  file.append(filename[42:])
                  #print(file)
                  date.append(line[15:])    # store all found filedates in array
                  #print(date)
                  list_logfile = list(zip(file,date))
                  #print(list_logfile)
  
  
  # ---------- Loop 2 for finding string ------------------------------------------------------
      for line in filesearch:
              if tester in line:  # extract "Sending Request: Tester"
                  data = []
                  message = []
                  start = '-&gt; '   # take string from
                  end = ':\ '     # ens string at
                  number = line[line.find(start) + 3: line.find(end)]  # [ord('-&gt; '):ord(' :\ ')]
                  data.append(number)  # store all found tester in a array
                  text = line[line.find(end) + 3:]
                  message.append(text)    # store all found comments in a array
                  print(data)
  
      down here i want to append the first file filename1 to the frist loop of strings , 
  then append filename2 with the next loop of strings, 
  then the next and next...
  </code></pre>