variable = 1 print('{}') # output: {} print('{{}}') # output: {{}} print(f'{{}}') # output: {} print(f'{variable}') # output: 1 print(f'{{variable}}') # output: {variable} print('{}'.format(variable)) # output: 1 print('{{}}'.format(variable)) # output: {} print('{variable}'.format(variable)) # output: error print('{{variable}}'.format(variable)) # output: {variable}
如果我的陈述存在疏漏还请不吝赐教,感激不尽!
如果觉得有用就请点个赞吧,创作动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)