I have:
N = a list of numbers from 0-29
A = a list of all alphabet letters.
I want to combine them in order to get all possible permutations of "NAN", from 0a0 up to 29z29
Then, I want to use each one of these "NAN" permutations and get them inside a URL, so I can get something like "http://www.geo.ma/NAN.txt"
import string
import itertools
#Generate the letter list
Alist=list(string.ascii_lowercase)
#Generate the number list
Nlist=list(range(30))
#Combine them in order to get "ABA"
CombinedList=(list((itertools.product(Nlist, Alist, Nlist))))
print(CombinedList)
I got the list, but now I try to get the permutations inside the URL:
for i in CombinedList:
print('http://www.geo.ma/', i)
But i get
http://www.geo.ma/ (29, z, 29)
instead of what I'd like to get:
http://geo.ma/29z29.txt
If I try to convert the List to string before trying to generate the URLS with StringedList = str(CombinedList), python just uses each one of the characters to generate the URLs, so I get things like http://geo.ma/].txt, http://geo.ma/9.txt, http://geo.ma/z.txt, http://geo.ma/).txt, http://geo.ma/).txt, etc.