String Concatenation
To concatenate, or combine, two strings you can use the + operator.
Example
Merge variable a
with variable b
into variable c
:
a = "Hello"
b = "World"
c = a + b
print(c)
To concatenate, or combine, two strings you can use the + operator.
Merge variable a
with variable b
into variable c
:
a = "Hello"
b = "World"
c = a + b
print(c)
Strings in python are surrounded by either single quotation marks, or double quotation marks.
‘hello’ is the same as “hello”.
You can display a string literal with the print()
function:
print("Hello")
print('Hello')
You can use quotes inside a string, as long as they don’t match the quotes surrounding the string: Continue reading Python Strings