3.2: 🧵 String Variables

Topic

3.2: 🧵 String Variables

Topic Progress:

For our second lesson on variables, we will be investigating python’s “string” variables. In programming, rather than being yarn, a string is our way of representing text. Here are three different variables:

aVariable = 5
anotherVariable = 'five'
aThirdVariable = '5'

The first variable is a numerical type, which we covered in our last lesson. The last two variables (anotherVariable and aThirdVariable) are both string (text) type variables. This is because they have ‘single quotation marks’ around them. Note: Even though aThirdVariable is set to 5, Python will treat it as text rather than as a number, because it is surrounded by quotation marks.

For this exercise, your task is to make a change to the third line of the following code, so that the second print() statement outputs something different from the first one.

For those who found the above challenge too easy, try fixing the below code so that it says hello to you by name.
Hint: you only need to add one line, the rest of the code doesn’t need to be edited (but you can change it to make it say something else if you want!)

@

Not recently active