Why would """ be used? Does it mean anything?

https://www.codecademy.com/paths/computer-science/tracks/cspath-python-objects/modules/cspath-python-strings/lessons/string-methods/exercises/splitting-strings-iii

The triple quote marks “”" showed up in this exercise.

For some reason when I typed in “”" it is not coming out right on codecademy but if you click the link you will see what I mean. Thanks

If you press the </> you can format it. I can’t access the lesson but are you asking why you would use a split method? If you post the example code you’re curious about me and others can chime in freely.

Sometimes triple quotation marks are used as multi-line comments:

"""
comment
comment
"""

It could also be if one wanted to have a string on multiple lines:

some_var = """string
string
string"""

But if you gave the code, we could say for sure.

2 Likes

Or maybe this?

sentence = 'words"to"live"by'
split_sentence = sentence.split('"')
print(split_sentence)
# ['words', 'to', 'live', 'by']
1 Like

Thanks it was a string taking up multiple lines.