hechengQAQ

导航

 

2023年4月10日

摘要: 一、__format__(self, format_spec) 当我们使用format()方法对一个对象进行格式化时,如果这个对象有__format__方法,那么这个方法就会被调用。它接受一个变量作为参数,并返回一个格式化后的字符串。 class Person: def __init__(self, 阅读全文
posted @ 2023-04-10 12:18 hechengQAQ 阅读(23) 评论(0) 推荐(0) 编辑