-3

I'm new to Python and I'm learning from Tutorials Point. They use the term "statement" a lot. Is that like the term "command"? What does it mean?

Benny
  • 31
  • 5
  • 2
    Looking for `python statement` on Google leads you directly to the [relevant documentation](https://docs.python.org/3/reference/simple_stmts.html). See also the following chapter, Compound Statements. – Paulo Almeida Sep 05 '15 at 23:33

1 Answers1

2

In computer programming a statement is the smallest standalone element of an imperative programming language that expresses some action to be carried out. It is an instruction written in a high-level language that commands the computer to perform a specified action. A program written in such a language is formed by a sequence of one or more statements. A statement may have internal components (e.g., expressions).

https://en.wikipedia.org/wiki/Statement_(computer_science)

Fabio
  • 3,015
  • 2
  • 29
  • 49
  • So if I understood it right, statement are like commands, but when you are coding you are using the term statement because it doesn't doing a action in real time like a command ? – Benny Sep 05 '15 at 23:27
  • @Benny Very simplistically a statement is when you tell the program to do something like `a = 5` or `if (x > 3) { return (x) } else { return (3) }`. The if - else thing is a compound statement btw. But something like `a == 3` isn't a statement, it's an expression, cause it's evaluating to something, not doing something – Fabio Sep 05 '15 at 23:30
  • Some good info written by Joel Spolsky (founder of SO) himself in the accepted answer of this question: http://stackoverflow.com/questions/19132/expression-versus-statement – Fabio Sep 05 '15 at 23:33
  • Understood thank you, and if it's okay, I have one more question: Does the term "command" have a meaning in Python ? – Benny Sep 06 '15 at 00:05