Python - String Manipulation (Part-1)
Question and Answers
CBSE Class 11 - Informatics Practices
Q1: What is a string in Python?
Answer: String is a sequence of characters, which is enclosed between either single(' ') quotes or double quotes(" "), python treats both single and double quotes same.
e.g.
str1 = "Welcome to the Python World."
Q2: Can a double-quoted string contain single quotes? If yes, give an example.
Answer: Yes.
Example:
str1 = "Nitika's Fashions"
print(str1)
Similarly, A single-quoted string can also contain double quotes:
Example:
str2 = '"Help!", he exclaimed.'
print(str2)