DEMO #1: In this interactive activity, learn how your program compares strings to see if they're the same or different!

We use the equality comparison operator == (double equals signs) to see if two strings are the same.

  • User input is stored as a string exactly as the user enters it. Computers are exact - "codesters" is NOT the same as "Codesters"!
  • Click Run to practice comparing strings.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)