# Built In Functions

{% embed url="<https://www.youtube.com/embed/iTjxPj5E_OI>" %}

You are going to learn a lot about functions later but right now we need to know how to use the functions that Python and other developers have given us. We have already seen the `print` function which allows us to print messages to the terminal.

Functions are called by specifying the name: `func` and then putting parentheses after the name: `func()`. Functions often take arguments which you will put place inside of the parentheses: `func(arg1, arg2)`. Many (but not all) functions return things from them.

## **`string <-- input('message')`**

Prints out the given message to the terminal and then waits for the user to type in a message and press enter. The message the user typed is returned from the function as a `string`.

## **`string <-- str(anything)`**

Takes any data type and converts it to a `string`.

## **`int <-- int(string)`**

Takes a `string` representation of a number (`"42"`) and converts it to an `int`.

## **`float <-- float(string)`**

Takes a `string` representation of a number (`"3.14"`) and converts it to a `float`.

## **`int <-- len(string)`**

Finds the length of a `string` (how many characters) and returns it as an `int`.

&#x20;*Try collecting some data from the user and then print out a specialized message like* *"It's a pleasure to meet you {name}"!*


---

# 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://programming.reedcwilson.com/lesson-1/built-in-functions.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.
