Back

Codekata problem need solution

Created 3 years ago
149 Views
3 Comments
ManchalaThTyV9
@ManchalaThTyV9
ManchalaThTyV9
@ManchalaThTyV9Profile is locked. Login

The Caesar Cipher technique is one of the earliest and simplest method of encryption technique. It’s simply a type of substitution cipher, i.e., each letter of a given text is replaced by a letter some fixed number of positions down the alphabet. For example with a shift of 1, A would be replaced by B, B would become C, and so on. The method is apparently named after Julius Caesar, who apparently used it to communicate with his officials.For the given input string(S) and shift print the encrypted string.
Sample Testcase :
INPUT
ABCdEFGHIJKLMNOPQRSTUVWXYz 23
OUTPUT
XYZaBCDEFGHIJKLMNOPQRSTUVw

My code:

a,b=input().split(" ")

b=int(b)

string=""

for i in range(b,len(a)):

string=string+a[i]

for i in range(0,b):

string=string+a[i]

print(string)

output:

>> Compiling your code
Output:
XYzABCdEFGHIJKLMNOPQRSTUVW
Execution Time:
>>> 0.02s
Memory Used:
>>> 3264kb

need to change output to this XYZaBCDEFGHIJKLMNOPQRSTUVw

please help me

Comments (3)
Please login to comment.