7/ Math expressions: Eliminating ambiguity

Add parentheses:

result_of_computation = ((2 * 4) * 4) + 2

Coding exercices


8/ Concatenating text strings

greeting = "Hello"
addressee = "World"
whole_greeting = greeting + addressee

You can use the plus sign to sum numbers, and you can use it to concatenate strings. But you can't use the plus sign to combine strings and numbers. If you write this code, you get an error message:

print("The sum of 2 plus 2 is " + 4)

Coding exercices