06 2017 档案

摘要:程序代码 class Person: #constructor def __init__(self,name,sex): self.Name = name self.Sex = sex def ToString(self): return 'Name:'+self.Name+',Sex:'+self 阅读全文
posted @ 2017-06-19 15:29 漫舞沧海 阅读(1117) 评论(0) 推荐(0)
摘要:字符串格式化 Python的字符串格式化有两种方式: 百分号方式、format方式 百分号的方式相对来说比较老,而format方式则是比较先进的方式,企图替换古老的方式,目前两者并存。 1、百分号方式 %[(name)][flags][width].[precision]typecode (name 阅读全文
posted @ 2017-06-12 23:15 漫舞沧海 阅读(109) 评论(0) 推荐(0)