liveBook · Manning

Print

As explained in A Pythonic Adventure: From Python basics to a working web app

The Python print function writes text or other values to standard output.

Use print() to make a Python program speak. It writes a greeting, a value, or several pieces of an order to the program’s output. section 1.2

A coffee shop greeting

A first program can display “Welcome to Erik’s Coffee Shop!” Running it immediately shows the greeting, and additional print() calls can present a customer’s name, drink, flavor, topping, and a thank-you message. section 1.2

Listing 1.1 The first version of the coffee shop application
print("Welcome to Erik's Coffee Shop!")
 
name = input("Please enter your name: ")
drink = input("Please enter your drink: ")
flavor = input("Please enter your flavor: ")
topping = input("Please enter your topping: ")
print("Here is your order, ", name)
print("Main product: ", drink)
print("Flavor: ", flavor)
print("Topping: ", topping)
print("Thanks for your order!")

Explore a complete first version of the coffee shop application, including print() calls that display collected order details. section 1.2

How A Pythonic Adventure: From Python basics to a working web app covers it

How deep it goes
Demonstrates repeated calls and values alongside text, without discussing print() internals or formatting rules.
Examples
Uses a coffee shop welcome message, customer responses, and a receipt-like order summary.
What it assumes
Assumes only a first Python 3 program and teaches output through a simple greeting before adding order details.
What you can do after
Apply it via Python’s print() function to display fixed text and collected values in a runnable program.
How it connects
Connects print() with input() and variables to echo responses and present an assembled order.

Also explained in

Compare how 5 books explain print →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of A Pythonic Adventure: From Python basics to a working web app. The section links point to the parts of the book it draws on.