What is a statement?


#1

Question

This exercise calls print a “statement”. What is a statement in programming?

Answer

In programming we call anything that carries out some action a statement. Programs you’ll write will be made up of many statements that work together to produce a desired result, output something useful, or act on some existing data, among infinitely many other possibilities!

A statement isn’t necessarily always a single line, either. For example, you’ll learn in a bit about things called if statements, which can contain as many statements inside of them as you like!
Kind of confusing, right? Like anything else, it’ll become much clearer as you practice and write more code.


FAQ: Learn Python - Python Syntax - Print Statements