python 字符串模板,,from strin
文章由Byrx.net分享于2022-01-02 02:01:40
python 字符串模板,,from strin
from string import Templateprint(type(Template))mystr = Template("hi,$name 你是$baby")print(mystr.substitute(name = "边真", baby = "lovely "))
输出
# 结果<class ‘string._TemplateMetaclass‘>hi,边真 你是lovely
python 字符串模板
相关内容
- Python3 运算符,,什么是运算符?举个简
- Python 文件处理,,文件是日常编程中常用
- Python 字典,,Python 字典1
- Python lower()方法,,描述Python l
- Python常用的运算符,,1、算术运算符---
- python 遍历字典,,python 遍历字
- python 字典,,1.如何交换字典 {
- python数据结构与算法(16),,时间复杂度最优时间复
- python 文件操作,,文件基本操作:# -
- python例子,,list1 = [[
评论关闭