Quick actions

cmd+k|ctrl+k

Navigation

Languages

HW_Solution_Sept13_2023

Snippet info

Language

Python

Visibility

public

Author

masterhun

Created

2023-09-13T17:23:22.583115Z

Updated

2023-09-13T17:46:04.627143Z



# Part A

# What is the missing code? 
# Complete the code. 

# This for loop converts ciphertext into plaintext.

ciphertext = "97 98 99"

# ciphertext = "116 104 105 115 32 105 115 32 97 32 115 101 99 114 101 116"

plaintext = ""

# "97 98 99" => "abc"

numbers = ciphertext.split()

for number in numbers:
    letter = ""
    # missing code block
    # temp = int(number)
    # letter = chr(temp) 
    # or 
    letter = chr(int(number))
    # missing block of code 
    plaintext += letter


print("CIPHERTEXT: " + ciphertext)

print("PLAINTEXT: " + plaintext)

INFO