In [69]:
temp = "gluhtlishjrvbadvyyplkaohavbyjpwolypzavvdlhrvuuleatlzzhnlzdpajoavcpnlulyljpwolyrlfdvykpzaolopkkluzftivsvmklhaoputfmhcvypalovsilpuluk"
alphabet = "abcdefghijklmnopqrstuvwxyz"
def shift(shift_num):
output = ''
for index, s in enumerate(temp):
# new_index = (shift_num + index) % 25
# new_index = (alphabet.index(s) + sift_num) % 25
# output += alphabet[new_index]
# output.append((alphabet.index(s), (alphabet.index(s) + shift_num)%25))
new_index = (alphabet.index(s) + shift_num)%25
output += alphabet[new_index]
return output
In [67]:
print(shift(14, temp))
In [70]:
from ipywidgets import interact, interactive, fixed
In [71]:
interact(shift, shift_num=(0,25))
In [ ]: