EOFError on python 3 codecademy magic 8 ball step 1

i know I’m not doing anything wrong here, even chatGPT agrees with me.
Here’s whats causing the error:

name = input("Please state your name here: ")

I’m using python 3 runtime environment on codecademy

1 Like

Hard to tell w/what you posted. There might be an indentation error somewhere in the code(?).
Does the code run on your own computer in an IDE? Often, the CC LE doesn’t allow for the input() function.

Also, (I realize there’s no New User Guide any longer, but there used to be).

When asking a question:

  • please include a link to the lesson the post is referring to.

  • please format code:


I first had made all the steps i was asked to do in the lesson, but never ran the code.
When It came up with that error I first asked chat GPT, which said that the code is fine.
I also checked the indentation. Heres the link: https://www.codecademy.com/courses/learn-python-3/projects/python-magic-8-ball

As for the formatting of the code, I’ll try that. but i just skipped the lesson because i already know that subject from python 2.

name = input("Please state your name here: ")

Like I mentioned above, the CC learning environment doesn’t allow for the input() function to be utilized, so, an exception was raised.
Check the docs:

If it works fine on your own computer using an IDE, then that’s the issue. If you still get the issue on your IDE, then you have an error somewhere.

I double checked the project and no where does it ask for the input() to be utilized.

name = " "
question = ""
import random

random_number = random.randint(1,10)


#logic if no name provided
if len(name) == "":
  print("Question " + question)
  print(name + " asks " + question)  

#logic if no question asked
if len(question) == "":
  print("Magic 8-ball will not work unless you provide a y/n question.")
1 Like

Thanks, I guess I read the instructions wrong. :no_mouth: Thanks! I’m glad we have people like you to help out Juniors like me! :upside_down_face:

1 Like