Math issues


#1

So I’m a beginner at python and im learning out a big book from 2014 or 15. So I get to the part where it is talking about equations and I did a simple one: (2+2)*3, and when I did the run command it would say that it was correct but it wouldn’t show the answer of the equation. Is there a package that I can install that would show the answer or am I doing something wrong

Picture here:

Thank you if you can help me!


#2

You need to run the python file and actually print the result.

In the file:

#!/usr/bin/python

print ((2 + 2) * 3)

Then run the python script in the terminal with

./filename.py


#3

I’d advise using file extensions for your files, as they make it a whole lot easier for you and anyone who reads your code to identify the Python scripts. Additionally, the extension will make sure that you don’t have to include a shebang line like in the above post.


#4

Thank you that fixed it!