You had a logical error there, always replacing chars in the b64ed
string, so only the last of the replacement characters could actually be replaced. So you would see changes only if b64ed
happened to contain the randStr[5]
character, otherwise final_product
would just be the exact same as b64ed
.
Part of your code should look like this:
final_product = b64ed
for i in range(6):
final_product = final_product.replace(str(randStr[i]) , str(randStr2[i]))
print(str(randStr[i]) + " to " + str(randStr2[i]))
6
solved When running this code, it doesn’t actually replace the strings… Why? Also, will making this be practical?