I have two text files "usernames.txt" and "passwords.txt" and I want to have them print out in a specific order, I have a snippet of code that does exactly what I need but I feel like It can be shortened.
with open('passwords.txt','r') as f:
for line in f:
for password in line.split():
with open('usernames.txt','r') as f:
for line in f:
for username in line.split():
print username +":"+ password
This works perfect for me what I feel like I can make it even shorter!
current output is this:
username1:password
username1:password1
username1:password2
username2:password
username2:password1
username2:password2