shh_algo_PY

Celeste - Cipher Project

Jul 15th, 2022
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.02 KB | None | 0 0
  1. print("THIS IS CELESTE CIPHER PROJECT")
  2. print("satu: encrypt a message etselec way...")
  3. print("dua: decrypt a message from etselec way...")
  4. answer = input()
  5. alpha = [
  6.     'a' ,'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',
  7.     'l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
  8.  
  9. while answer != "satu" and answer != "dua":
  10.     answer = input("HEY!! are you malaysian? Yes? malay you don't know meh? No? sry but satu means ONE and dua means TWO")
  11.  
  12. if answer == "satu":
  13.     print("Alright! Flipy Flapa Time!")
  14.     text = input("Please ENTER your secret sentence you want to encrypt (in all lower letters):")
  15.     encode = []
  16.     for i in text:
  17.         if i in alpha:
  18.             encode.append(str(alpha.index(i)+2))
  19.     print("/".join(encode))
  20.  
  21. elif answer == "dua":
  22.     print("Alright! Flapa Flipy Time!")
  23.     num = input("Please ENTER your secret sentence you want to decrypt (in all lower letters):").split("/")
  24.     decode = ""
  25.     for i in num:
  26.         decode = decode + alpha[int(i)-2]
  27.     print(decode)
Advertisement
Add Comment
Please, Sign In to add comment