Advertisement
TrustierSafe240

ZAD23

May 21st, 2025
144
0
177 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | Source Code | 0 0
  1. c=lambda c,s:chr((ord(c)-(b:=65*c.isupper()+97*c.islower())+s%26+26)%26+b) if c.isalpha() else c
  2. def t(p="Odszyfrowac? (T/N): "):
  3.     while(o:=input(p).lower().strip())not in{'t','n'}:print("Prosze wybiez T lub N.")
  4.     return o=='t'
  5. print("Zaszyfruj swoja wiadomosc")
  6. print(''.join(c(x,3)for x in input()))
  7. print()
  8. if t():
  9.     print("\nco chcesz odszyfrowac?")
  10.     print(''.join(c(x,-3)for x in input()))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement