-1

I am just starting to learn Python.

Yesterday I started python and got

>>>

I entered hello world and it worked.

Yet, today I get that bash doesn't recognize print. I am working on a course from Coursera and it requires python 2.7.

How do I know if I have that or python 3?

bryan kennedy
  • 6,969
  • 5
  • 43
  • 64
Ross
  • 1
  • 1
  • 4
    Question not clear. Please post a [mcve]. – sjsam Jul 02 '16 at 17:31
  • 1
    `python -v` checks version. Check [\[ this \]](http://stackoverflow.com/questions/6141581/detect-python-version-in-shell-script) too.. – sjsam Jul 02 '16 at 17:41
  • 2
    bash and python are two completely different programs and languages. Why are you mixing them?. – stark Jul 02 '16 at 18:05
  • 1
    bash is correct, it does not have a `print` command, but python does. You must enter `python` to get the python prompt `>>>`. – cdarke Jul 02 '16 at 19:06

1 Answers1

0

As alluded to in the comments, bash is a shell and command language while Python is a high-level programming language.

To get what you want in Python, use the print command

enter image description here

The print command does not exist in bash. So use the echo command

enter image description here

results:

enter image description here

tale852150
  • 1,618
  • 3
  • 17
  • 23