Start learning free

LESSON 9 OF 671 · VARIABLES

The Power of Variables in Go

Lesson

Variables let us change a program's behavior by changing stored values instead of rewriting the whole program.

For example, this program builds a sentence from two variables:

experience := 5
language := "Go"

fmt.Println("I have " + strconv.Itoa(experience) + " years of experience with " + language)

If experience or language changes, the printed story changes automatically.


Assignment
Change the variables so the story says the person has 13 years of experience with Java. Do not change the print statement.


Hint
Use experience := 13 and language := "Java".


STEP 1 OF 1
    Ctrl + Enter to check