Skip to content

The print() function

  • Lesson
  • 1 min read
  • 2 of 6 in this chapter

The print() function

In all programming languages, a program is typically expected to return some output. If we want to see the output on the console (terminal, command prompt, etc) we will need to incorporate the print() function. The print function works like this:

Python
some_number = 7
print(some_number)
some_string = "this text is called a string"
print(some_string)

OUTPUT

Text
7
this text is called a string

Throughout this course, we will be using this function to see the output of all the operations we perform with code.

This will be very useful for testing software, but the console output of the print() function is typically not used in software that is put out for production.