letters=["A","B","C"..............,"X","Y"]
password_list=[]
for i in range(1 , 5):
password_list += random.choice(letters) <--- No error
is working but,
password_list=[]
for i in range(1 , 5):
password_list = password_list + random.choice(letters) <--- error
giving error of cannot concatenate string, if both are same just syntax is different then why it is giving error?
can someone explain this briefly?
PS:- if required i will attach the Screenshot of problem.
Thank you
nr_letters, letters+ missing imports. Why iterate overfor char in range(1,nr_letters+1)and never usechar(which is a number, not a char) instead of iteratingfor _ in range(nr_letters):wich iterates as much.