Python EOF error

I’m working on Sal’s Shipping problem in the LEARN PYTHON 3 course.
https://www.codecademy.com/courses/learn-python-3/projects/sals-shipping?action=resume_content_item

I wrote the following code:

#Get client to input weight of package
print("Hello. How much does your package weigh? ")
weight = float(input())
print(“I understand that your package weighs: " + str(weight) + " lbs.”)

When I run it on the Codecademy interface, I get the following error:

Hello. How much does your package weigh?
Traceback (most recent call last):
File “script.py”, line 3, in
weight = input()
EOFError: EOF when reading a line

However, I’ve also downloaded Pycharm and when I run the code on Pycharm, it runs fine. Why would this be?

I need for it to run in Codecademy too so that I can advance in my course.
Thanks for your help.

Please post a link to the exercise so we can test your code.

Thanks. I’ve added the link.

The only thing that comes to mind is that the OS does not support input(), which may be a result of the way CC has implemented Python in the Learning Environment.

For this exercise use literal values to get around the issue.

Thanks. I believe you’re right. It seems that CC doesn’t support input(). I wonder why they would do that.

1 Like

With millions of users all manner of things can go wrong; or, in the case of informed users it might lessen their ability to exploit the environment.

1 Like