GoalScope — caesar_cipher (Qwen2.5-Coder-32B-Instruct) — hover a token to see the patched verbalization
↵
<code>↵
def caesar_cipher(s, shift):↵
"""Encrypts the string s using a Caesar cipher with the given shift."""↵
result = ""↵
for char in s:↵
if char.isalpha():↵
shift_amount = shift % 26↵
if char.islower():↵
start = ord('a')↵
else:↵
start = ord('A')↵
new_char = chr(start + (ord(char) - start + shift_amount) % 26)↵
result += new_char↵
else:↵
result += char↵
return result↵
</code>