cdactvm commited on
Commit
62a7bce
·
verified ·
1 Parent(s): eb91430

Upload isNumber.ipynb

Browse files
Files changed (1) hide show
  1. isNumber.ipynb +51 -0
isNumber.ipynb ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "id": "ac442c1a-b404-4936-afec-7e4eb43bb68b",
7
+ "metadata": {},
8
+ "outputs": [],
9
+ "source": [
10
+ "# Function to check if the string is a number\n",
11
+ "def is_number(x):\n",
12
+ " if type(x) == str:\n",
13
+ " x = x.replace(',', '')\n",
14
+ " try:\n",
15
+ " float(x)\n",
16
+ " except:\n",
17
+ " return False\n",
18
+ " return True"
19
+ ]
20
+ },
21
+ {
22
+ "cell_type": "code",
23
+ "execution_count": null,
24
+ "id": "639ab4a5-6c8e-4ced-8736-a9a283e3bdb7",
25
+ "metadata": {},
26
+ "outputs": [],
27
+ "source": []
28
+ }
29
+ ],
30
+ "metadata": {
31
+ "kernelspec": {
32
+ "display_name": "Python 3 (ipykernel)",
33
+ "language": "python",
34
+ "name": "python3"
35
+ },
36
+ "language_info": {
37
+ "codemirror_mode": {
38
+ "name": "ipython",
39
+ "version": 3
40
+ },
41
+ "file_extension": ".py",
42
+ "mimetype": "text/x-python",
43
+ "name": "python",
44
+ "nbconvert_exporter": "python",
45
+ "pygments_lexer": "ipython3",
46
+ "version": "3.11.7"
47
+ }
48
+ },
49
+ "nbformat": 4,
50
+ "nbformat_minor": 5
51
+ }