Used words
10/3/2001
Ester Fayez
Hello world!
Ciphertext:
---------------------------------------------
|
Cybersecurity
Mug
Design
------------------
Ester
Fayez
Python
Code
for
Caesar
Cipher
#
Variables
birthday
=
name
Function
def
caesar_cipher(text
shift):
encrypted_text
""
char
in
text:
if
char.isalpha():
shifted
ord(char)
+
shift
char.islower():
>
ord('z'):
-=
26
elif
<
ord('a'):|
+=
char.isupper():
ord('Z'):
ord('A'):|
chr(shifted)|
else:
return
Example
Usage
plaintext
3
ciphertext
caesar_cipher(plaintext
shift)|
print(
ciphertext)
|------------------------------------------
Create your own