We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
defcaesarCipher(s,k):# Write your code hererotator=k%26answer=""foritemins:temp=itemifitem.isalpha():curr=ord(item)+rotatorascii_value=0ifitem.isupper():ascii_value=int(curr-26)ifcurr>ord('Z')elsecurrelifitem.islower():ascii_value=int(curr-26)ifcurr>ord('z')elsecurrtemp=chr(ascii_value)answer+=tempreturnanswer
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Caesar Cipher
You are viewing a single comment's thread. Return to all comments →