This answer is broken; my answer is correct. Not only that, but the following should also be correct:
translations = {
‘mountain’: ‘orod’,
‘bread’: ‘bass’,
‘friends’: ‘mellon’,
‘horse’: ‘roch’
}
But above code is also not recognized as being correct. Is there a way to make it so that it can be identified as a valid answer?
The screen shot shows stylized quotes. This happens when we copy code from a post then paste it into the LE editor. Go through the code in the editor and replace with standard quotes.
My code is this
translations = {“mountain”: “orod”, “bread”: “bass”, “friend”: “melon”, “horse”: “roch”}
but it says
Expected dictionary to be: {‘mountain’: ‘orod’, ‘bread’: ‘bass’, ‘friend’: ‘mellon’, ‘horse’: ‘roch’}
Hey, @olufemioluranti there isn’t a difference, both are used for strings.
But generally, double quotes " " are used for string representation and single quotes ’ ’ are used for regular expressions or dictionary keys. Hence both single quote and double quotes depict string in python, but it’s sometimes our need to use one type over the other.