-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Expand file tree
/
Copy pathnumbers.py
More file actions
83 lines (62 loc) · 716 Bytes
/
numbers.py
File metadata and controls
83 lines (62 loc) · 716 Bytes
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#Some negative numbers
-1
-10000000000000000
-1.0
-3.0e17
-(1)
-(10000000000000000)
-(1.0)
-(3.0e17)
(-1)
(-10000000000000000)
(-1.0)
(-3.0e17)
-1j
-3.7e12j
#Some other numbers
0.058823529630899429
1e-06
.9999999
0xffffff
1e10
1.
2.79252680
0x0001000
4987312561856745907287624786230562734672583763984576267
#Octal both styles
0777
0o777
#Python2 longs
0
0L
5L
-2L
498731256185674590728762478623056L
0xfffffffL
0xeeeeeeeeeeeeeeeeL
0b00010101011111111111L
0o77777777777L
0777777777777L
0j
0_0234j
0e0
#Valid uses of underscore:
1_1
1_2_3.4_5_6e7_8_9
0b1_1
0o1_1
0x1_1
0b_010
0o_010
0x_010
#Invalid uses of underscore:
1__3
2e_5
2e+_5
123_
#Valid prefixed zero:
0_0
009.
009e005
00123
1 if 1else 0