Introduction
In this article, I will explain strings in Python.
Definition
In Python, string data type is used to print a string statement in the output screen. We use symbol single quotations (or) double quotations to give the same result.
(“c# corner” is the same as ‘c# corner’).
Example
- print("c# corner")#double quotation
- print('c# corner')#single quotation
Output

Assign String Variables
In Python, to assign string variables, we use any alphabetic sentence(or) alphabet. The variable name is followed by an equal symbol and the string. (a=” welcome”)
Example
- a=("welcome,'c# corner'")#double quotation and single quotation
- print(a)#To print the output screen (a) assigned string variables.
Output

Multiline strings
In Python, we can assign one more lines to a variable. We use three quotes as the symbol. (“”’ some statement “””)
Example
- a = '''''Great Wall of China.. ...
- Christ the Redeemer in Rio de Janeiro ...
- Machu Picchu in Peru. ...
- Chichen Itza. ...
- Roman Colosseum. ...
- Taj Mahal in India. ...
- Petra in Jordan.'''
- print(a)
Output






Join the conversation! Your thoughts help the community grow.