例を無視してください、それは私が現在学んでいる本の中にあります。
7はPythonをサポートしていないため、これをNetbeans 6.9.1で実行しています:(出力コンソールで実行しようとするとエラーが発生します。コードは、教科書に書かれている内容とまったく同じです。私が考えることができるのは、Net Beansは2.7.1しかサポートしていないのに、私が学んでいる本はPython 3.1です。これが問題になる可能性がありますか?何か見落としがあった場合はお知らせください。
これが基本的なスクリプトです。
# 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
-みんなありがとう。