lintcode 有效数字
来源:互联网 发布:手机淘宝店店招 编辑:程序博客网 时间:2024/04/30 20:05
class Solution: """ @param: s: the string that represents a number @return: whether the string is a valid number """ def isNumber(self, s): # write your code here s=s.replace('.','') s=s.replace(' ','') s=s.replace('+','') s=s.replace('-','') if len(s)==0 or s[0]<'0' or s[0]>'9': return False s1="0"+s try: a=float(s1) return True except: return False
阅读全文
0 0
- LintCode:有效数字
- lintcode,有效数字
- lintcode 有效数字
- 有效数字-LintCode
- LintCode刷题:有效数字
- [Lintcode]Valid Number有效数字
- LINTCODE——有效数字(待改进)
- lintcode-有效回文字符串
- LintCode : 有效回文串
- LintCode-有效回文串
- lintcode --有效回文串
- 有效回文串,lintcode
- lintcode:有效回文串
- 有效回文串-LintCode
- 有效数字
- 有效数字
- 有效数字
- lintcode 有效的括号序列
- 《UNIX网络编程 卷2》 笔记: 简介
- CodeForces 664 C.International Olympiad(构造)
- 进程与线程
- JAVA中的权限修饰符
- 四大隔离机制
- lintcode 有效数字
- 华山论剑之jvm03 JVM 垃圾回收介绍
- ROS机器人研讨会课程资料
- 识别条形码
- 虚函数之析构函数和构造函数
- jspSmartUpload上传中文乱码解决
- 使用strtk来切割文本
- 生活
- 富文本编辑器的用法