Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7896501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:54:38+00:00 2026-06-03T07:54:38+00:00

Please ignore the example, it is just in a book I am currently learning

  • 0

Please ignore the example, it is just in a book I am currently learning from.

I am running this in Netbeans 6.9.1 as 7 doesn’t support Python 🙁 and I am getting a error when trying to run it in the output console. The code is exact as to what is written in the text book. The only thing I can think of is that net beans only supports 2.7.1 yet the book I am learning from is Python 3.1. Could this be the issue? Please let me know if I have overlooked something.

Here is the basic script;

# Word Problems
# Demonstrates numbers and math

print("If a 2000 pound pregnant hippo gives birth to a 100 pound calf,");
print("but then eats 50 pounds of food, how much does she weigh?");
input("Press the enter key to find out.");
print("2000 - 100 + 50 =", 2000 - 100 + 50); 

input("\n\nPress the enter key to exit");


Traceback (most recent call last):
  File "/Users/Steve/Desktop/NewPythonProject/src/newpythonproject.py", line 6, in <module>
    input("Press the enter key to find out.");
  File "<string>", line 0

^
SyntaxError: unexpected EOF while parsing

-Thanks guys.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T07:54:40+00:00Added an answer on June 3, 2026 at 7:54 am

    The issue is that input() means something different in Python 3.x. In Python 2.x, the equivalent function is raw_input().

    Simply replace your calls to input() with ones to raw_input() and it will work as expected:

    # Word Problems
    # Demonstrates numbers and math
    
    print("If a 2000 pound pregnant hippo gives birth to a 100 pound calf,")
    print("but then eats 50 pounds of food, how much does she weigh?")
    raw_input("Press the enter key to find out.")
    print("2000 - 100 + 50 =", 2000 - 100 + 50)
    
    raw_input("\n\nPress the enter key to exit")
    

    The reason this caused a problem is that in Python 2.x, input() takes user text, then interprets it as a Python expression. As you were giving it a blank line, which is an invalid expression, it throws an exception.

    I would highly suggest using a different editor if you are learning Python 3.x. PyCharm is great (albeit not free), and Eclipse+Pydev is out there. To be honest, you don’t really need an IDE for Python – a good text editor like Gedit that supports code highlighting is all you really need.

    Also note I removed the semicolons, which are entirely redundant in Python.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently teaching myself Python and was just wondering (In reference to my example
This is not a real situation; please ignore legal issues that you might think
Please take a look at this spider example in Scrapy documentation. The explanation is:
(please ignore this question - it is foolish...) I want something that will do
In our code I have the following, for now please ignore the //* bits;
Please consider this code: template<typename T> char (&f(T[1]))[1]; template<typename T> char (&f(...))[2]; int main()
Please could someone post an example of how to check if an element exists
Well I am a newbee so kindly please ignore if there is any mistake
I'm doing a Pyjamas example and get this error: TodoApp InternalError: too much recursion
After reading this SO question and noting the consensus about just how evil Thread.Sleep()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.