SHARE
TWEET

4q Prova de quarta

DomMisterSoja Sep 19th, 2018 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. l=''
  2. print('1-Para inserir a frase a ser criptografada\n2-Discriptografar a frase')
  3. escolha=int(input())
  4. if escolha==1:
  5.     arquivo = open('crip.txt', 'w')
  6.     a = input('Insira a palavra a ser criptografada')
  7.     for i in a:
  8.         b=ord(i)
  9.         b=b+3
  10.         c=chr(b)
  11.         l+=f'{c}'
  12.     arquivo.writelines(l)
  13.     arquivo.close()
  14.     print(l)
  15. if escolha==2:
  16.     arquivo=open('crip.txt','r')
  17.     for i in arquivo:
  18.         for a in i:
  19.             b=ord(a)
  20.             b=b-3
  21.             c=chr(b)
  22.             l+=f'{c}'
  23.  
  24.     print(l)
  25.     arquivo.close()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top