2015年7月6日

Python之简单工厂模式实现

摘要: 最近又看了下大话设计模式,决定用Python来试着实现下。基础类1 class OperationBase():2 """3 基础运算类4 """5 result = 06 def GetResult(self):7 return self.r... 阅读全文

posted @ 2015-07-06 21:09 ListenWind 阅读(667) 评论(0) 推荐(0)

判断Python输入是否为数字

摘要: 在接收raw_input方法后,判断接收到的字符串是否为数字例如:str = raw_input("please input the number:")if str.isdigit():为True表示输入的所有字符都是数字,否则,不是全部为数字str为字符串str.isalnum()所有字符都是数字... 阅读全文

posted @ 2015-07-06 15:23 ListenWind 阅读(81855) 评论(0) 推荐(1)

导航