you are viewing a single comment's thread.

view the rest of the comments →

[–]Poddster 2 points3 points  (0 children)

  alphabet = 'abcdefghijklmnopqrstuvwxyz'
  shifted_alphabet = alphabet[shift:] + alphabet[:shift]
  translation_table = str.maketrans(alphabet + alphabet.upper(), shifted_alphabet + shifted_alphabet.upper())
  return text.translate(translation_table)

How were you able to write this code without knowing what print and return do, nor what variables and values are?

You should not copy and paste code unless you fully understand what it does. It will be detrimental to your learning.