Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # lowercase alphabet has the values of 97 - 122
- if (ord(char) >= 97) and (ord(char) <= 122):
- return chr(97 + (alphabet_position(char) + rot) % 26)
- # uppercase alphabet has the values of 65 - 90
- elif (ord(char) >= 65) and (ord(char) <= 90):
- return chr(65 + (alphabet_position(char) + rot) % 26)
- else:
- # If not a letter, this will return the exact character
- return char
- # lowercase alphabet has the values of 97 - 122
- if (ord(letter) >= 97) and (ord(letter) <= 122):
- return ord(letter) - 97
- # uppercase alphabet has the values of 65 - 90
- elif (ord(letter) >= 65) and (ord(letter) <= 90):
- return ord(letter) - 65
- else:
- pass
- text_new = ""
- for pos in range(len(text)):
- text_new += rotate_character(text[pos], int(rot))
- return text_new
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement