Search⌘ K
AI Features

Print and Import Statements

Explore how to effectively use the print function to display output with multiple arguments and control line endings. Discover how import statements allow you to access external functions and modules such as math, enabling you to extend your Python programs beyond built-in capabilities.

Print statement

Print “statements” are actually calls to a function named print, but everybody uses them as statements. You can give print any number of arguments, and they will all be printed on the same line with spaces between them.

Take a look at this example:

Python 3.5
x = 5
print('x =', x) # Printing value of x -> 5

Print arguments

Each ...