Please help me figure this out



Is there a way you can modify my code so that it prints the output of this code into a .txt document? Can you show me what the new code will look like. Thank you in advance

This code outputs every combination that can be made with those characters. The combination is only 3 characters long max.

import itertools
res = itertools.product('abcdefghijklmnopqrstuvwxyz1234567890 ',repeat = 3) # 3 is the length of your result.
for i in res: 
   print ''.join(i)


the python course covers this: link to exercise

You can just follow the lesson, and then implant it outside codecademy


As covered in the earlier thread on this topc, there are ~54 000 lines in the generated file. Even at 90 lines a page, it will consume 600 sheets of paper. What this seems to point to is the ability to create a large random sequence that is to a high probability, very unique. By high, we mean 37! to 1.

This can be done mathematically The randomness would need to be worked out.


Thank you guys. I'll go and look at the lesson


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.