I was just wondering if it is possible to add an apostrophe in this situation. I want the test key to have the value of "I don't know" not "I don". Is it possible to do so? If so how?
my_dict = {
"test": 'I don't know'
}
I was just wondering if it is possible to add an apostrophe in this situation. I want the test key to have the value of "I don't know" not "I don". Is it possible to do so? If so how?
my_dict = {
"test": 'I don't know'
}
You can either wrap the value in double quotes:
{"test": "I don't know"}
or escape the apostrophe:
{"test": 'I don\'t know'}
You can do either of two things. You can to this:
my_dict = {
"test": "I don't know"
}
or you can also do this:
my_dict = {
"test": 'I don\'t know'
}
Either works and both are pretty much the same.