Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google foobar Challenge EOFError

I am trying to complete my first challenge on Google foobar challenges and I am stuck with an error which I can't seem to fix no matter what I do!

def answer(plaintext):
    plaintext = raw_input('(string) plaintext = ')

answer(plaintext)

I get EOFError [line 2].

But, when I do this:

def answer(plaintext):
    try:
        plaintext = raw_input('(string) plaintext = ')
    except(EOFError):
        return
answer(plaintext)

then I get an error which says, all the test cases failed.

What's going wrong?

like image 925
Rajendra Kodumuri Avatar asked May 23 '26 15:05

Rajendra Kodumuri


1 Answers

You are missing following:

return plaintext;

You have to return something after processing the input(s).

like image 129
Bhagwan Parge Avatar answered May 26 '26 05:05

Bhagwan Parge