Below is a function which rotates a string by value of rot variable , but output is not coming as expected pls tell

s=input("enter string ")
rot=(int(input())%26)
for i in s:
val=ord(i)
if val+rot<=122:
i=chr(val+rot)
else:
diff=val+rot-122
i=chr(96+diff)
print(s)

please share your code by saving it on ide.codingblocks.com