MCPcopy Create free account
hub / github.com/HuberTRoy/leetCode / isNumber

Method isNumber

String/ValidNumber.py:40–49  ·  view source on GitHub ↗

:type s: str :rtype: bool

(self, s)

Source from the content-addressed store, hash-verified

38
39class Solution(object):
40 def isNumber(self, s):
41 """
42 :type s: str
43 :rtype: bool
44 """
45 try:
46 float(s)
47 return True
48 except:
49 return False

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected