2.2: 🎯 Combining Output

Topic

2.2: 🎯 Combining Output

Topic Progress:

We can also use the + symbol to combine different strings. This will be especially useful when we want to print variables out. To combine two strings within a print command, we write the two strings with a + in between, like this:

print("hello"+"world")
or
print('hello'+'world')

Your task for this lesson is to write some code to print out “hi my name is” followed by your name.

Side note: It’s worth noting that even though it’s most intuitive to print strings (Things in “quotation marks”) you can put a bunch of things inside print statements like numbers. This can be very handy when we want to know what a variable is at a particular time. You’ll see why this might be handy in the Variables section if it isn’t immediately clear now. Just note that the print statement can be used in a bunch of ways.

@

Not recently active