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
Post a Comment