STEP 6: Let's combine our string and variable to make a sentence!

Data types tell us about the kind of data that is stored in a variable. In this example, we want to combine a string and an integer to form a sentence. Since they're different types, they can't be combined with just a plus sign +.

  • We need to tell the computer to temporarily pretend that the integer variable is a string by using str().
  • Now replace the string in the rectangle's .say() command with "My area is " + str(200).

# THIS ACTIVITY IS IN PREVIEW ONLY MODE