The string is a message or a sentence or a paragraph. A string in Python has to be surrounded by a single quotation(') or double quotation(").
print('Hello')
print('Welcome to artofcse.com')
Output:
Hello
Welcome to artofcse.com
message = "Welcome to ArtOfCSE"
name = 'Jone Doe'
print(message)
print(name)
Output:
Welcome to ArtOfCSE
Jone Doe
for c in "hello world":
print(c)
message = "Hello, World!"
print(len(message))
message = "Welcome to Artofcse"
print("Artofcse" in message)
message = "Welcome to Artofcse"
print("Artofcse" not in message)
first_name = "Jone "
last_name = "Doe"
full_name = first_name + last_name
print(full_name)
text = "Welcome to \"ArtofCSE\"."
text2 = 'Dhaka is Bangladesh\'s Capital '
message = 'This is first line. \nThis is another line'
print(text)
print(text2)
print(message)