# First Python Program

The ruggedBOARD A5D2x comes with an inbuilt python interpreter, let us see some simple examples of running small python codes on your board. \
Let's dive in.

There are two ways you can write a python code, \
1\. Using shell as our python interpreter.\
2\. Writing code on a text editor (eg: vi, vim, etc..) and using the interpreter to compile it

**Using Shell as our interpreter**

**Step 1: Enter into your board's terminal, type in `python` and hit the \<Enter> key**

**Step 2: Now we are inside an inbuilt python interpreter. Here we can type in some simple python codes and play around for a while.**\
**Given below are a set of screen shots to which you can refer and start off wrinting python codes.**

![Example 1: Say hello to our Board :)](https://3659589761-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LbvnQRGvCTc2Zmsi6BG%2F-Ldh-4xnSoyMfmw24ah_%2F-Ldh7hAM4JWgt1JlLEtn%2FEx_1.jpg?alt=media\&token=3d2f3235-1856-469a-b0f9-9565d3884a5d)

![Example 2: Basic arithmatic operations](https://3659589761-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LbvnQRGvCTc2Zmsi6BG%2F-Ldh-4xnSoyMfmw24ah_%2F-Ldh7q6tDVufuIQ9_1dr%2FEx_2.jpg?alt=media\&token=f41b4c5e-bc76-4f84-8959-f817acb1a19b)

**Method 2:**

**Step 1: Write any python code on a text editor and then save it with a** `.py` **extension.** \
**You can use the code given below(In our example we save it as filename.py)**

```
#Example program in python that adds two numbers.

num1 = 6.8
num2 = 8.9
sum = num1 + num2
print(sum)
```

**Step 2: Run the code using** `python filename.py`&#x20;

**You should be able to see the output as**\
`15.7`
