Double vs. single quotes inside of lists

In this project, we are asked to create a list of school subjects. Up until this project, the lesson on lists has only uses single quotes for strings inside of lists. However, this project uses double quotes for strings inside of lists:

When I learned about strings, I thought I was taught that is doesn’t really matter what type of quotes you use for strings, as long as you use the same type of quote at the beginning of the string and at the end of the string. I know it is helpful to use single quotes for strings if you intend to use double quotes inside of the string and vice versa, but I don’t understand why the lesson would use single quotes for strings inside of lists and then this project would use double quotes. Is there a reason for this?

Hi @okaraman7,

It’s difficult to know for certain why they chose to use double quotes as delimiters here. Quite likely, it was arbitrary, or perhaps the author of the project figured that names of courses are more likely to contain single quotes than double quotes. That might matter if you decided to play with the code to change the course names used here to ones from an actual college catalog.

To check that hypothesis, I searched a Stony Brook University Schedule of Classes for Fall 2019, but found only one course name that contained a single quote. See below.

So much for that hypothesis. ¯\_(ツ)_/¯

1 Like

@appylpye thank you for your response! I’m glad I’m not missing some obvious explanation here. Thanks again!

1 Like