0

So I just started learning Python. In my book it was given that print() is a function in Python 3.x whereas it is a statement in Python 2.x

What exactly is the difference between a statement and a function?

Note - I am a beginner and excuse me if this seems too silly.

PS - I saw this answer but I couldn't understand it. Elaborating it would be appreciated.

Kaushik
  • 187
  • 3
  • 13
  • https://stackoverflow.com/questions/43435850/what-is-the-difference-between-a-statement-and-a-function-in-python – Mohit Solanki Sep 24 '19 at 19:33
  • 1
    Also check out https://stackoverflow.com/q/9307291 for a slightly better answer that applies to many languages. – iz_ Sep 24 '19 at 19:42
  • @iz_ So is statement the order given to the Python interpreter to take a specific action? Is function set of statements that perform a specific action (It can be used elsewhere in the program when needed)? Is it? Also, in Python 2.x `print "Hello World!"` is valid. Isn't? – Kaushik Sep 24 '19 at 19:48

0 Answers0