--
You received this message because you are subscribed to the Google Groups "Python GCU Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-gcu-for...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/python-gcu-forum/79874707-42c6-4a06-ab99-d6c384f2e4fbn%40googlegroups.com.
def rot13(text):
  result = []
  for char in text:
    if 'a' <= char <= 'z': # lowercase letters
      result.append(chr((ord(char) - ord('a') + 13) % 26 + ord('a')))
    elif 'A' <= char <= 'Z': # uppercase letters
      result.append(chr((ord(char) - ord('A') + 13) % 26 + ord('A')))
    else:
      result.append(char) # leave non-alphabet characters unchanged
  return ''.join(result)
if __name__ == "__main__":
  password = input("Enter your password: ")
  encoded = rot13(password)
  print(f"Encoded (ROT13): {encoded}")
To view this discussion visit https://groups.google.com/d/msgid/python-gcu-forum/CAGJv-n6jFHe4OM5wSwNu86%3D%2B659B3MRrj6yNhnvSJaUvtgEeYw%40mail.gmail.com.