Task:
The script must read the text from the in.txt file, prompt the user for the password that must be entered by him from the keyboard. Further, the source text is hashed using the md5 algorithm and is written to the new file.
Comment to the code written:
"The solution is still illogical. Write just so that the password entered by the user is encrypted and written to the file."
import hashlib as hl f = open('C:\\abc\in.txt', 'w') p = 'Zolotie Kupola' if p == input('Enter the password: ', ): h = hl.md5(b'C:\\abc\in.txt') f.write(str(h.hexdigest())) else: print('Uncorrect password') f.close()