Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- plainText = input("Digita una parola in lettera minuscola: ")
- distance = int(input("Digita il valore della distanza (intero positivo < 26): "))
- w = ""
- cipherValue = []
- for ch in plainText:
- n = 0
- ordValue = ord(ch)
- if ordValue <= 120:
- cipherValue.append(ordValue + distance)
- else:
- cipherValue.append(ordValue - (26 - distance))
- n = n + 1
- print("La parola criptata รจ: ", end='')
- for n in cipherValue:
- crypto = chr(n)
- print(crypto, end='')
Advertisement
Add Comment
Please, Sign In to add comment