Ask coding questions

← Back to all posts
I understand why this wont work.
MisledWater79 (0)

I’m trying to make something like a enigma machine so i’m starting on making something like the rotors that turn each time you press a key. and i want it to shift the alphabet I have and then print it to show that it did shift it over by one.

Comments
hotnewtop
MikeJMS8910 (160)

try using the str() function to turn the value into a string. I think all you would need to do is something like pos = alpha.find(str(num)) if that doesn't work then before that line do num = str(num)