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 π€
βs.
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.
Instructions
Use π
βοΈ
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!