---
title: "input"
space: "Student Handbook"
url: "https://portal.cs17.org/student-handbook/python-manual/built-in-functions/input"
updated: "2026-10-05"
---

Asks the user to type something, and returns it as a string.

## Synopsis

```python
input(prompt)
```

## Description

`input` shows the prompt, then waits until the user presses Enter. It returns what they typed, without the Enter.

The result is **always a string**, even when the user types a number. Use `int` or `float` to turn it into a number.

## Parameters

| Name | Meaning |
| --- | --- |
| `prompt` | Text to show first. Optional. End it with a space so the answer does not touch it. |

## Return value

A `str`: what the user typed.

## Example

```python
name = input("What's your name? ")
print(f"hello, {name}")
```

It prints:

```text
What's your name? David
hello, David
```

## Common mistake

```python
x = input("x: ")
y = input("y: ")
print(x + y)
```

It prints:

```text
x: 1
y: 2
12
```

`input` returns strings, and `+` joins strings, so 1 and 2 make `12`. Convert first: `x = int(input("x: "))`.

## See also

[int](/student-handbook/python-manual/built-in-functions/int), [float](/student-handbook/python-manual/built-in-functions/float), [print](/student-handbook/python-manual/built-in-functions/print)

[input in the Python documentation](https://docs.python.org/3/library/functions.html#input)
