|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# 半角数字print("1".isdigit()) # Trueprint("1".isdecimal()) # Trueprint("1".isnumeric()) # True# 半角数値(符号付き)print("0.01".isdigit()) # False print("0.01".isdecimal()) # False print("0.01".isnumeric()) # False # 半角数値(小数)print("0.01".isdigit()) # False print("0.01".isdecimal()) # False print("0.01".isnumeric()) # False # U+0660を含む場合print("0٠01".isdigit()) # True print("0٠01".isdecimal()) # True print("0٠01".isnumeric()) # True # 全角数字print("1".isdigit()) # Trueprint("1".isdecimal()) # Trueprint("1".isnumeric()) # True# 全角漢数字print("百".isdigit()) # False print("百".isdecimal()) # Falseprint("百".isnumeric()) # True# 全角ローマ数字print("Ⅳ".isdigit()) # False print("Ⅳ".isdecimal()) # False print("Ⅳ".isnumeric()) # True |
コメントを残す