liveBook · Manning

Prompt

As explained in Get Programming: Learn to code with Python

A prompt is text displayed by a program to request information from a user.

A prompt is text displayed by a program to request information from a user. In Python, place a prompt string inside input(); the program displays it and waits until the user presses Enter. End the prompt with a space so the user's response does not run into the question. section 11.2

A prompt connected to stored input

user_place = input("Where do you live? ") text = user_place.capitalize() + "!" print(text) The program asks a question, stores the user's string, changes its capitalization, and prints the result.

input("What's your name? ")

View the compact prompt syntax: input("What's your name? "). section 11.2

How Get Programming: Learn to code with Python covers it

How deep it goes
Explains display, waiting, spacing, storage, string handling, and numeric conversion through short code examples.
Examples
Uses name, location, secret, color, symbol, and number questions, including stored responses and calculations.
What you can do after
Apply it via Python's input() function to request, store, transform, and calculate with user responses.
How it connects
Connects prompts to user input, strings, variables, and type conversion.

Also explained in

Compare how 50 books explain prompt →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Get Programming: Learn to code with Python. The section links point to the parts of the book it draws on.