在Python中,%对字符串做什么? [英] What does % do to strings in Python?
本文介绍了在Python中,%对字符串做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我没有找到运算符%的文档,因为它用于Python中的字符串。有人知道文档在哪里?
解决方案
这是字符串格式化运算符。请阅读 Python中的字符串格式。
格式%值
创建一个字符串,其中格式
指定格式,值
是要填写的值。 p>
I have failed to find documentation for the operator % as it is used on strings in Python. Does someone know where that documentation is?
解决方案
It's the string formatting operator. Read up on string formatting in Python.
format % values
Creates a string where format
specifies a format and values
are the values to be filled in.
这篇关于在Python中,%对字符串做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文