MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / dencrypt

Function dencrypt

ciphers/rot13.py:2–11  ·  view source on GitHub ↗
(s, n)

Source from the content-addressed store, hash-verified

1from __future__ import print_function
2def dencrypt(s, n):
3 out = ''
4 for c in s:
5 if c >= 'A' and c <= 'Z':
6 out += chr(ord('A') + (ord(c) - ord('A') + n) % 26)
7 elif c >= 'a' and c <= 'z':
8 out += chr(ord('a') + (ord(c) - ord('a') + n) % 26)
9 else:
10 out += c
11 return out
12
13
14def main():

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected