為什么把雙引號改成單引號就運行失敗了,不一樣嗎
import json
class Students(object):
? ? def read(self):
? ? ? ? return r'['Tim', 'Bob', 'Alice']'
s = Students()
print json.load(s)
為什么把雙引號改成單引號就運行失敗了,不一樣嗎
import json
class Students(object):
? ? def read(self):
? ? ? ? return r'['Tim', 'Bob', 'Alice']'
s = Students()
print json.load(s)
為什么把雙引號改成單引號就運行失敗了,不一樣嗎
2020-03-24
舉報
2020-03-28
改成單引號兩個單引號會就近匹配,變成 r'[' ........