Moduuli 14: Ohjelmointi, teknologia ja data
ChatGPT:n käyttö ohjelmoinnissa, teknologioissa ja datassa

Moduuli kesken.
Esimerkki ChatGPT:n kyvykkyydestä.
"+(=%+( /+ 0!?**/". Ymmärsitkö mitä tuo tarkoitti? Et varmaankaan, sillä se oli salakirjoitusta, jonka avaamiseen tarvitaan avain.
You
ChatGPT
ChatGPT
Analyzed
python
Always show details
Copy code
# Let's encrypt the given sentence "Nimeni on Matti" using the provided substitution cipher.
# Substitution cipher mapping from the example provided
cipher_map = {
'A': '!', 'B': '2', 'C': '#', 'D': '4', 'E': '%', 'F': '6', 'G': '&',
'H': '8', 'I': '(', 'J': '0', 'K': '*', 'L': '-', 'M': '=', 'N': '+',
'O': '/', 'P': '<', 'Q': '>', 'R': '?', 'S': '@', 'T': '^', 'U': '_',
'V': '`', 'W': '~', 'X': '|', 'Y': '\\', 'Z': '['
}
# Sentence to encrypt
sentence = "Nimeni on Matti"
# Encrypt the sentence
encrypted_sentence = ''.join(cipher_map.get(char.upper(), char) for char in sentence)
encrypted_sentence
Result
'+(=%+( /+ =!^^('
Lause "Nimeni on Matti" salakirjoitettuna edellä määritellyllä salakirjoitusaakkostolla on "+(=%+( /+ =!^^(".
Entä Nimeni on Jarkko kyseisellä salakirjoitusaakkostolla?
# Let's encrypt another sentence "Nimeni on Jarkko" using the provided substitution cipher.
# Sentence to encrypt
sentence_jarkko = "Nimeni on Jarkko"
# Encrypt the sentence using the same cipher map as before
encrypted_sentence_jarkko = ''.join(cipher_map.get(char.upper(), char) for char in sentence_jarkko)
encrypted_sentence_jarkko
Alalyzed
# Re-defining the substitution cipher map and encrypting the sentence "Nimeni on Jarkko" as previous state was reset.
cipher_map = {
'A': '!', 'B': '2', 'C': '#', 'D': '4', 'E': '%', 'F': '6', 'G': '&',
'H': '8', 'I': '(', 'J': '0', 'K': '*', 'L': '-', 'M': '=', 'N': '+',
'O': '/', 'P': '<', 'Q': '>', 'R': '?', 'S': '@', 'T': '^', 'U': '_',
'V': '`', 'W': '~', 'X': '|', 'Y': '\\', 'Z': '['
}
# Sentence to encrypt
sentence_jarkko = "Nimeni on Jarkko"
# Encrypt the sentence
encrypted_sentence_jarkko = ''.join(cipher_map.get(char.upper(), char) for char in sentence_jarkko)
encrypted_sentence_jarkko
Result
'+(=%+( /+ 0!?**/'
ChatGPT