From 23812f9d83e138dea4eb6938bdcf5e00706029a1 Mon Sep 17 00:00:00 2001 From: Velaga Abijith <cb.en.u4cse16260@cb.students.amrita.edu> Date: Wed, 2 Jan 2019 23:25:43 +0530 Subject: [PATCH] q9 done --- cse16260_ex2_q9.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 cse16260_ex2_q9.py diff --git a/cse16260_ex2_q9.py b/cse16260_ex2_q9.py new file mode 100644 index 0000000..d57e90d --- /dev/null +++ b/cse16260_ex2_q9.py @@ -0,0 +1,12 @@ +str=input("enter a string :") +shift=int(input("enter the value of the shift amount")) +s="" +for i in str: + if i==' ': + s=s+i + elif i.isupper(): + s=s+chr(int(ord(i)+shift-65)%26+65) + else: + s=s+chr(int(ord(i)+shift-97)%26+97) +print(s) + -- GitLab