# Exercise - Work with output

## Your first program

You'll use a Jupyter Notebook to create your first program. Your senior officer wants you to create code to perform a couple of utilities. You will start by displaying today's date. Then you will add code to convert parsecs to lightyears.&#x20;

This exercise is broken into a series of steps. For each step you will be presented with the goal for the step, followed by an empty cell. Enter your Python into the cell and run it. The solution for each step will follow each cell.&#x20;

## Display today's date

In the cell below, add the code to display today's date. Remember you can use `date` object from `datetime` library to access calendar.

```python
# Add the code below
from datetime import date
print(date.today())
```

Your code should look like the following:

```python
from datetime import date
print(date.today())
```

## Build a unit converter

Now it's time to turn your attention to the second utility, converting parsecs to lightyears. One parsec is 3.26 lightyears, so you will multiply parsecs by that value to determine lightyears.&#x20;

Create a variable named `parsecs` and set it to `11`. Then add the code to perform the appropriate calculation and store the result in a variable named `lightyears`. Finally print the result on the screen with so it displays a message which resembles the following:

**11 parsecs is \_\_\_ lightyears**

{% hint style="info" %}
Remember to you can use `str` to convert numbers to strings
{% endhint %}

Your code should resemble the following:

```python
parsecs = 11
lightyears = parsecs * 3.26
print(str(parsecs) + "parsecs is " + str(lightyears) + " lightyears")
```

## Desired output

When you run the notebook you should see the following result:

```
11 parsecs is 35.86 lightyears
```


---

# 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://learn.pqtkha.com/programming/technology/python/microsoft-training-python-for-beginners/module-1-write-your-first-python-programs/exercise-work-with-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.
