Python Strings
Python Strings
name = "Python"
print(name)
message = "I love Python."
print(message)
Output
Python
I love Python.
In the above example, we have created string-
type variables: name and message with
values "Python" and "I love
Python" respectively.
Here, we have used double quotes to represent
strings but we can use single quotes too.
print(message)
Output
Never gonna give you up
Never gonna let you down
In the above example, anything inside the
enclosing triple-quotes is one multiline string.
# using + operator
result = greet + name
print(result)
# Output: 5
print(replaced_text)
# Output: 12
# Output: True
# Output: True
# Output: 7