In everyday conversation, “data” can mean a lot of things… In programming, however, data means something very specific: pieces of information categorized into specific types.
In the previous exercise, we briefly met one of these data types: strings! Strings are words or pieces of text that the computer treats as a single item. A string is a sequence of characters. It can be any length and contain any letters, numbers, symbols, or spaces surrounded by
Here are four different examples of strings:
🔤This is a string!🔤 🔤This is also a string!!!🔤 🔤1337🔤 🔤👆👍🔤
It’s important to distinguish between strings and the rest of the code in our programs. Every part of a program is made up of characters, but strings are the parts we intend to keep as data—not as instructions to be executed by the computer.
We’ll meet more data types in a later lesson, but for now, let’s really get to know strings.
❗️ to print a string made up only of number characters.
Use a second
❗️ to print a string made up of only letters.
Alright, one more…
Use a third
❗️ to print any string you want!