# Output

{% embed url="<https://docs.google.com/presentation/d/1KNFs4MhlXDs9vo8WI9LdDUhvhVnkwZ8tdlMR-AesKcI/edit?usp=sharing>" %}

## print function

The print function prints output to the console.

{% code title="hello.py" %}

```python
print("Hello World!")
```

{% endcode %}

{% code title="Terminal" %}

```bash
$ python hello.py 

```

{% endcode %}

{% code title="Output" %}

```
Hello World!
```

{% endcode %}

{% hint style="info" %}
Objects are automatically converted to string representations for printing.
{% endhint %}

Reference: <https://docs.python.org/3/library/functions.html#print>

## String Concatenation and Formatting

String concatenation is the operation of joining character strings.  In Python, there are several ways to concatenation strings. &#x20;

### Comma

```python
print("hello","world")
```

### String Concatenation

```python
print("hello" + " " + "world")
```

### String Interpolation

```python
print("{0} {1}".format("hello","world"))
```

### Format Literals&#x20;

Python 3.6 introduced format literals, with a more elegant syntax (less redundancy).

```python
greeting = "hello"
who = "humans"
print(f"{greeting} {who}")
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.pythonclassroom.com/output.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
