# Ch2 - Types, Variables and Simple I/O

## Module Objectives

* Use triple-quoted strings and escape sequences to manipulate text
* Make programs do maths
* Store data in computers memory
* Use variables to access and manipulate that data
* Get input from users to create interface programs

### Using Quotes Inside Strings

When creating strings we surround them with quotes. Can either be single or double quotes.

**`>>>print ("Program 'Game Over' 2.0") Program`** \
\&#xNAN;**`Program 'Game Over' 2.0`**

The double quotes above are like bookends. They tell the computer where the string starts and ends, so you can use as many single quotes you want between the "bookends"\
This would be the same if the bookends were single quotes, you can use as many double quotes between the single quote bookends as you want.

**`>>>print ('Program "Game Over" 2.0')`**\
**`Program "Game Over" 2.0`**

### Printing Multiple Values

You can print multiple values with a single call to the `print ()` function,  just like multiple arguments separated by commas.\
\&#xNAN;**`>>>print ("Same", "message", "as before")`**\
**`Same message as before`**`   `            &#x20;

{% hint style="info" %}
Notice that each value is printed with a space as a separator. This is default behaviour of the **`print ()`** function.\
You can separate them over multiple lines, the result will be the same. Sometimes used to break up code for easier reading.\
\&#xNAN;**`>>>print ("Just",`** \
&#x20;         **`"a bit",`** \
&#x20;         **`"bigger")`** \
**`Just a bit bigger`**
{% endhint %}

### Specifying a Final String to Print

Specifying `the print()` function prints a newline character as a final value (i.e. it returns carriage to a new line `>>>`

This can be changed and instead of the final string being printed is a newline, you can define what the final sting to print will be. You could specify that a space could be the final character to be printed and not a newline when you call the `print ()` function\
This would mean a subsequent `print ()` function


---

# 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://python.microcisco.com/python-programming/python-for-abs/ch2-types-variables-and-simple-i-o.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.
