From 0559215dbeac2778659ef426f72d718a3d9cc47c Mon Sep 17 00:00:00 2001 From: Vivin Balaji K S <cb.en.u4cse16265@cb.students.amrita.edu> Date: Wed, 12 Dec 2018 10:23:54 +0530 Subject: [PATCH] Upload New File --- CSE16265_ExNo02_09.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 CSE16265_ExNo02_09.py diff --git a/CSE16265_ExNo02_09.py b/CSE16265_ExNo02_09.py new file mode 100644 index 0000000..6323c62 --- /dev/null +++ b/CSE16265_ExNo02_09.py @@ -0,0 +1,12 @@ +a=input("Enter the string") +shift=int(input("shift value ")) +print(a) +f="" +for i in range(len(a)): + c=a[i] + if c.isupper(): + f+=chr((ord(c)+shift-65)%26+65) + else: + f+=chr((ord(c)+shift-97)%26+97) +print(f," encrypted string") + -- GitLab