i m trying to use ord and chr, but there is no result at the prompt ? i guess it s something with chr because earlier i was having an error of that ciphertext wasnt an interger, suggesting me to use str that i tried but didnt work. what i am missing
~/workspace/pset6/ $ python caesar.py 3 plaintext: Hello ciphertext: Retry: here is section of my code where i use ord and chr:
import cs50 import sys
....
#for each caracter in the text
for c in range(len(plaintext)):
if plaintext[c].isalpha():
conversion_key = int(ord('c') + k)
ciphertext = chr('conversion_key')
print("{}".format(ciphertext))
else:
print(plaintext[c])#for each caracter in the text
for c in range(len(plaintext)):
if plaintext[c].isalpha():
conversion_key = int(ord('c') + k)
ciphertext = cs50.get_int()
ciphertext = chr('conversion_key')
print("{}".format(ciphertext))
else:
print(plaintext[c])