Double quotes and single quotes


#1

Hello,

I've noticed that on Lesson 13 and on Lesson 14, on description of a list and then a dictionary are used double quotes and on the editor side are used single quotes:

https://www.codecademy.com/en/courses/python-beginner-en-pwmb1/2/4?curriculum_id=4f89dab3d788890003000096

and

https://www.codecademy.com/en/courses/python-beginner-en-pwmb1/2/5?curriculum_id=4f89dab3d788890003000096

More than that on Lesson 10, are used only single quotes to describe a dictionary:

https://www.codecademy.com/en/courses/python-beginner-en-pwmb1/2/1?curriculum_id=4f89dab3d788890003000096

But why? Why is this alternation? As I noticed that both double quotes and single quotes have the same role in Python.


#2

You observe correctly. The only thing that matters is that the closing quote matches the opening quote. There is no other general rule.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.