4 Questions
What is the data type used to represent text in Python?
str
Which of the following is a correct way to create a multi-line string in Python?
multiline_string = '''First line Second line'''
Which of the following is the correct way to access the last character of a string 'my_string' in Python?
my_string[-1]
What does the method 'strip()' do when used on a string in Python?
Removes all leading and trailing whitespaces
Test your knowledge of Python strings with this quiz. Questions cover topics such as data type for representing text, creating multi-line strings, accessing characters, and using the 'strip()' method.
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free