Skip to Content
Learn
Hello World
Strings

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

1.

Use πŸ˜€ ❗️ to print a string made up only of number characters.

2.

Use a second πŸ˜€ ❗️ to print a string made up of only letters.

3.

Alright, one more…

Use a third πŸ˜€ ❗️ to print any string you want!

Folder Icon

Take this course for free

Already have an account?