Variables often hold text or numeric data. In golang there are several types of variables,

including strings and numeric variables.

Variables can be reused in your code. Arithmetic operations can be used on numeric variables.

String variables can also be changed (sub-strings, concatenation).

**Related course:**

Learn How To Code: Googleâ€™s Go (golang) Programming Language

## Variables in golang

### Numeric variables

Lets start with numeric variables. We create a program that calculates

the VAT for a given price.

Define a series of products, sum the price ex. VAT, then calculate the VAT and add it to the price.

Copy the code below and save the file as variables.XYZ

1 | package main |

All arithmetic operations can be run on variables: division (/), substraction (-), addition (+) and multiplication (*)

### Video

Video tutorial below:

### Exercises

- Calculate the year given the date of birth and age
- Create a program that calculates the average weight of 5 people.