'!a'?(使用?ascii()),?'!s'?(使用?str())?和?'!r'?(使用?repr())?可以用于在格式化某個值之前對其進行轉(zhuǎn)化:
這句話怎么理解?
print('常量?PI?的值近似為:?{}。'.format(math.pi))
print('常量?PI?的值近似為:?{!r}。'.format(math.pi))沒看出有什么區(qū)別???
添加回答
舉報
0/150
提交
取消
