SequencevsIterationwithSolution

Run Settings
LanguagePython
Language Version
Run Command
print("Sequence vs. Iteration") print() # Sequence print("This is sequence.") # A # Python built-in function ord() letter = "A" value = ord(letter) print(f"The character {letter} is {value} in ASCII.") # Output: 65 # B # Python built-in function ord() letter = "B" value = ord(letter) print(f"The character {letter} is {value} in ASCII.") # Output: 66 # C # Python built-in function ord() letter = "C" value = ord(letter) print(f"The character {letter} is {value} in ASCII.") # Output: 67 # 120 # Python built-in function chr() value = 120 letter = chr(value) print(f"The value {value} is {letter} in ASCII.") # Output: _____ # 121 # Python built-in function chr() value = 121 letter = chr(value) print(f"The value {value} is {letter} in ASCII.") # Output: x # 122 # Python built-in function chr() value = 122 letter = chr(value) print(f"The value {value} is {letter} in ASCII.") # Output: z print() print() # Iteration print("This is iteration.") plaintext = "this is a secret" ciphertext = "" # This for loop converts plaintext into ciphertext. for letter in plaintext: temp = 0 # integer variable # missing code block temp = ord(letter) # missing block of code ciphertext += str(temp) + " " print("PLAINTEXT: " + plaintext) print("CIPHERTEXT: " + ciphertext) # THE END
Editor Settings
Theme
Key bindings
Full width
Lines