Please help! My programme is outputting random strings, mixing up lower and upper case, and weirdest of all, it refuses to print plainText input as it is when it's not a letter - it insists on modifying it by key, which is hilarious since it doesn't modify textual output correctly by key.
Is there something I have misunderstood about scope in Python? Or is this about unicode? I just can't for the life of me see where the bug is.
The relevant excerpt of my code is below:
// check usage
// get key, modulo by 26
// get plainText
for i in range(len(plainText)):
# if not a letter, just print
if plainText[i].isalpha == False:
print("{}".format(plainText[i]), end="")
# if uppercase text, wraparound 90
elif plainText[i].isupper:
cipher = ord(plainText[i]) + key
if cipher > 90:
cipher -= 26
print("{}".format(chr(cipher)), end="")
# if lowercase text, wraparound 122
elif plainText[i].islower:
cipher = ord(plainText[i]) + key
if cipher > 122:
cipher -= 26
print("{}".format(chr(cipher)), end="")