import hashlib
def encrypt_string(s):
# Encode the input string to bytes
encoded_string = s.encode()
# Create a SHA-256 hash object
sha256_hash = hashlib.sha256()
# Update the hash object with the encoded string
sha256_hash.update(encoded_string)
# Get the hexadecimal representation of the hash
encrypted_string = sha256_hash.hexdigest()
return encrypted_string
s = "Python Programming"
encrypted_string = encrypt_string(s)
print(encrypted_string)
'''
run:
d15647d90cc9f8e341146110bf5058773171688b237d2f9b5704399a0b17c8bd
'''