Python Short Quiz #4 – Strings

Python basic short quiz. 5 Questions. Difficulty Level: Easy. Concept: Python Strings.

Hello Everyone! Welcome to the Short Quiz on Python Strings.

This Quiz contains of 5 simple questions. After completing the Quiz, immediately you will get the results displayed with correct answers.

If you would like to learn more on the concept, you can find our tutorial page Python Strings.

Please feel free to provide your feedback in the comments box in bottom of the page.

Happy Programming!

Welcome to your Python Basic Quiz #4 - Strings

1. 
What will be the output of the below code?

string = "Python"
print(string[2])
string[2] = 'A'

2. 
What will be the output of the below code?

multi_line = """This is a String.\nWell, It's multi-line."""
print(multi_line)

3. 
What will be the output of the below code?

string_1 = "Python"
string_2 = "Python"

print(id(string_1) == id(string_2))

4. 
Which of the below are the correct way of defining strings in Python?

Select all that apply

5. 
What will be the output of the below code?

string_1 = "Python"
string_1 = string_1 + '1'

print(id(string_1) == id(string_2))

Asha Ponraj
Asha Ponraj

Data science and Machine Learning enthusiast | Software Developer | Blog Writter

Articles: 86

Leave a Reply

Your email address will not be published. Required fields are marked *