Python Encryption -


so exam question i've followed specific pseudo code makes program encrypts number sequence using same principle ceasar cipher. should work reason returns error.

typeerror: 'int' object not iterable 

heres code, hope guys can me, appreciated

plainnum = input("enter number encode ")  codednum = ' ' key = input("enter key ")  in plainnum:     codednum = codednum + str((int(i)+key)%10)     print codednum 

use raw_input if expect string:

plainnum = raw_input("enter number encode ")  

input() interprets input if python code; enter 5 , it'll return integer, enter 'some text' (with quotes) , it'll return string. raw_input() on other hand returns entered input uninterpreted.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -