Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def cripta():
- a=open('arminuta.txt')
- p=a.read()
- a.close()
- criptato=''
- for i in p:
- if i in chiave:
- criptato+=chiave[alf.find(i)]
- else:
- criptato+=i
- return criptato
- def decripta(p,chiave):
- decriptato=''
- for i in p:
- if i in chiave:
- decriptato+=alf[chiave.find(i)]
- else:
- decriptato+=i
- return decriptato
- def intell():
- p=cripta()
- alf='abcdefghilmnopqrstuvz'
- a=open('parole.txt')
- b=a.read()
- a.close()
- listap=b.split('\n')
- voc=''.join(listap)
- statistica={}
- tot=len(voc)
- for l in alf:
- statistica[l]=(voc.count(l)-1)/tot
- print(statistica)
- dalfip={}
- tot=len(p)
- for l in alf:
- dalfip[l]=p.count(l)/tot
- print(dalfip)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement