Text Shift function in Python

后端 未结 5 425
陌清茗
陌清茗 2020-12-03 15:50

I\'m writing code so you can shift text two places along the alphabet: \'ab cd\' should become \'cd ef\'. I\'m using Python 2 and this is what I got so far:

         


        
5条回答
  •  眼角桃花
    2020-12-03 16:10

    It's easier to write a straight function shifttext(text, shift). If you want a prompt, use Python's interactive mode python -i shift.py

    > shifttext('hello', 2)
    'jgnnq'
    

提交回复
热议问题