I am getting this error in my code and i have never had it before and i have no idea what is causing it to happen. Does anyone know how i can fix my code and can someone explain what this error means
ERROR: Traceback:
in <module
in simple_encoder
EOFError: EOF when reading a line
def simple_encoder(s):
users_string = input("please enter a scentence to encode")
users_stringlower = users_string.lower()
encodedstr = users_string
for x in range(0, len(users_string)):
indexnumber = 0
count = users_stringlower.count[indexnumber]
LetterToEncode = users_string[indexnumber]
if count > 1:
encodedstr = encodedstr.replace(LetterToEncode, ']')
elif count == 1:
encodedstr = encodedstr.replace(LetterToEncode, '[')
indexnumber = indexnumber + 1
Usually, EOFError
refers to an End Of File error . That means that your program called input()
but failed to have any available input to read.
We cannot run the code you posted because we're missing some variables, like NumOfIterations
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.