> For the complete documentation index, see [llms.txt](https://docs.arkannis.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.arkannis.net/programming/courses/python-pcap-31-03-course/control-flow/accepting-input-from-user.md).

# Accepting Input from User

### Basic way of accepting input:

```python
input('Please enter your name: ') # Asks user to enter their name
```

### To use that data:

```python
name = input('Please enter your name: ')
print("Hello there " + name)
```

### To prevent the variable from containing the extra spaces:

```python
name = input('Please enter your name: ')
print("Hello there " + name.strip()) # Strip removes spaces
```

* Anything that the user types as input it will be taken as a `STRING` even if it is a number

### To do math:

```python
number = input('Enter your number: ')
print(5 + int(number))
```
