From the course: Certified Entry-Level Python Programmer (PCEP-30-02) Cert Prep

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Output messages to the console

Output messages to the console

- [Instructor] One of the most common operations that we do in Python is to output messages to the console. We do that using the print function. The print function will output messages to the standard output from the operating system. That is typically the console. The basic usage of that print function is just to pass any value as an argument in parenthesis. For example, print "This is an special message." But also it's possible to send multiple elements just by using comma. And those elements can even be of different types. They will all be converted into strings for them to be printed on the screen. But when you're sending multiple elements, there is no separator between them, not even a space. So if you want, you can add a separator. In this case, after you pass all the elements that you want to print, in the last comma, you can add a named argument that is called sep, s-e-p, equals. So that's the separator. And you…

Contents