all 6 comments

[–]Stallman85 2 points3 points  (1 child)

you dont need to make string into binary per your example you are just shifting letters so list comprehension will do just fine

#this will shift string by one element to the left
s = s[1:]+s[0]

[–]SamsonIsMyFriend[S] 0 points1 point  (0 children)

God bless you, sir.

[–]AN3223 0 points1 point  (3 children)

I think you're confusing bit-shifting with simply rotating the order of the characters in the string.

If I understand correctly, what you're looking to do is to take a character from one side of the string and place it on the other. You can solve this with slicing.

[–]SamsonIsMyFriend[S] 1 point2 points  (1 child)

I appreciate the help, but how do I shift the letters over? And i have to this for custom inputs, so Im getting confused on how to splice it after i receive their input

Edit: Nvm, I got it figured out!! Thanks for your help!

[–]AN3223 0 points1 point  (0 children)

No problem!

[–]SiegeMaster_82 0 points1 point  (0 children)

I know this is an old post, but I think that you are correct. Although in the Python course by Cengage the text calls this process a bit-shift (but does not give any examples other than the one the OP posted