Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. firstnames = ['Anthony','Timothy']
  2. lastname = ['Smith','Parker']
  3. temporarylist = []
  4. a = 0
  5. b = 0
  6. c = 0
  7. for item in lastname:
  8.     for item in firstnames:
  9.         temporarylist.insert(c, firstnames[a] + lastname[b])
  10.         print(temporarylist)
  11.         a = a + 1
  12.         c = c + 1
  13.     if a > len(firstnames) - 1:
  14.                 b = b + 1
  15.                 a = 0
  16.     file = open("Families.txt",'a')
  17.     file.write(lastname[b] + "/n")
  18.     file.close()
  19.  
  20.     print(lastname[b], '=', temporarylist)
  21.     file = open(lastname[b] + 'txt', 'w')
  22.     temporarylist = str(temporarylist)
  23.     file.write(temporarylist)
  24.     temporarylist = []
  25.     file.close()
  26.  
  27.     b = b + 1
  28.     a = 0
  29.     c = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement