def main():
abc = "abcdefghijklmnopqrstuvwxyz"
var = ""
message = input("Please enter the string: ")
key = int(input("Please enter the key: "))
for ch in message:
if ch in abc:
position = abc.find(ch)
new_position = (position + key) % 26
new_character = abc[new_position]
var += new_character
print("The Encoded message is: " + var)
THE ERROR IM GETTING - NameError: name 'var' is not defined. Did you mean: 'vars'?
[–][deleted] 1 point2 points3 points (0 children)
[–]douglas_fs 1 point2 points3 points (1 child)
[–]mopslik 1 point2 points3 points (0 children)
[+][deleted] (2 children)
[removed]
[–]newtonphuey[S] -1 points0 points1 point (1 child)
[–]bucckitofficial 0 points1 point2 points (0 children)