Check if a string can be converted to float.
(s)
| 122 | ) |
| 123 | |
| 124 | def is_float(s): |
| 125 | """Check if a string can be converted to float.""" |
| 126 | try: |
| 127 | float(s) |
| 128 | return True |
| 129 | except ValueError: |
| 130 | return False |
| 131 | def is_int(s): |
| 132 | """Check if a string can be converted to int.""" |
| 133 | try: |