We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

What Is Code?

Code is just a series of instructions a computer can follow one after another. Programs can have a lot of instructions.

The Boot.dev backend has 99,747 lines of code as I write this... and it's smaller than many other programs!

Remember how we used the print() instruction to print text to the console, like this?

print("this is a string of text")

Well, we can also use it to print numbers, which, unlike plain text strings, are not surrounded in quotes. This prints the number 42:

print(42)

More importantly, because they're numbers, we can do math with them! This also prints the number 42:

print(40 + 2)

First it calculates the sum inside the parentheses, then it prints the result.

Assignment

In Fantasy Quest, enchanted weapons deal bonus damage. Our hero's sword deals 250 damage normally, plus an additional 75 damage when it's enchanted.

Add + 75 after the 250 so the code prints the enchanted damage, 325.