Code: Selecteer alles
def crypt(string,times=1):
def shift(char,times):
#97-122
t=ord(char)
t+=times
if t>122:
t-=26
return chr(t)
a=""
for i in string:
if ord(i)>=97 and ord(i)<=122:
a+=shift(i,times)
else:
a+=i
return a