On On cs50 IDE, for problem set 6 Caesar, it keeps saying my program is wrong and giving me a 37% but it compiles perfectly. I checked with check50 and everything it say's it doesn't do it does precisely. Below, is my code and it should receive near a perfect score.
from cs50 import get_string
from sys import argv
def main():
if len(argv) != 2:
print("Usage: error")#check if enough arguements are passed
exit(1)
while True:
key = int(argv[1])#gets key as int and validates
if key > 0:
break
pretext = get_string("plaintext: ")
print("cipertext: ", end="");
for i in range(len(pretext)):#enciphers length of string
if str.isupper(pretext[i]):#uppercase letters
uppercase = ((ord(pretext[i]) - 65 + key)% 26)+65
print(chr(uppercase), end="")
elif str.islower(pretext[i]):#lowercase letters
lowercase = ((ord(pretext[i])- 97 + key)% 26)+ 97
print(chr(lowercase), end="")
else:
print("{}".format(pretext[i]), end="")
print()
if __name__=="__main__":
main()
[removed solution code]