@@ -41,9 +41,9 @@ Besides that, you have the following imports avaiable:
4141
4242So you can do:
4343
44- Counter(('Ann', 'Bob', 'Bob', 'Michael')) = Counter({'Bob': 2, 'Ann': 1, 'Michael': 1})
45- Counter(('Ann', 'Bob', 'Bob', 'Michael', 'michael')) = Counter({'Bob': 2, 'Ann': 1, 'michael': 1, 'Michael': 1})
46- Counter(name.title() for name in ('Ann', 'Bob', 'Bob', 'Michael', 'michael')) = Counter({'Bob': 2, 'Michael': 2, 'Ann': 1})
44+ Counter(('Ann', 'Bob', 'Bob', 'Michael')) -> Counter({'Bob': 2, 'Ann': 1, 'Michael': 1})
45+ Counter(('Ann', 'Bob', 'Bob', 'Michael', 'michael')) -> Counter({'Bob': 2, 'Ann': 1, 'michael': 1, 'Michael': 1})
46+ Counter(name.title() for name in ('Ann', 'Bob', 'Bob', 'Michael', 'michael')) -> Counter({'Bob': 2, 'Michael': 2, 'Ann': 1})
4747
4848### Computing checksums
4949
@@ -55,9 +55,9 @@ The python `hashlib.md5` and `hashlib.sha1` functions are avaiable under the nam
5555
5656The functions ` dnow ` , ` tnow ` and ` dtnow ` return respectively the current string-formatted date, time and datetime:
5757
58- dnow() = 03/05/2017
59- tnow() = 09:36:03
60- dtnow() = 03/05/2017 09:36:03
58+ dnow() -> 03/05/2017
59+ tnow() -> 09:36:03
60+ dtnow() -> 03/05/2017 09:36:03
6161
6262Notice that you need to have parenthesis after the function name to invoke the function call.
6363
@@ -68,12 +68,12 @@ While you can just use the regular python to do set computations, there's a few
6868
6969The functions takes two iterable arguments, which are turned into sets, and the computations are performed:
7070
71- set_intersect('foo bar', 'foo baz') = {'b', 'a', ' ', 'o', 'f'}
72- set_intersect('foo baz', 'foo bar') = {'b', 'a', ' ', 'o', 'f'}
73- set_difference('foo baz', 'foo bar') = {'z'}
74- set_difference('foo bar', 'foo baz') = {'r'}
75- set_symdiff('foo baz', 'foo bar') = {'z', 'r'}
76- set_symdiff('foo bar', 'foo baz') = {'z', 'r'}
71+ set_intersect('foo bar', 'foo baz') -> {'b', 'a', ' ', 'o', 'f'}
72+ set_intersect('foo baz', 'foo bar') -> {'b', 'a', ' ', 'o', 'f'}
73+ set_difference('foo baz', 'foo bar') -> {'z'}
74+ set_difference('foo bar', 'foo baz') -> {'r'}
75+ set_symdiff('foo baz', 'foo bar') -> {'z', 'r'}
76+ set_symdiff('foo bar', 'foo baz') -> {'z', 'r'}
7777
7878
7979### Formatting numbers
@@ -93,18 +93,18 @@ scientificNotation
9393
9494Example usage:
9595
96- formatnum(0.123456789, 4) = 0.1235
97- formatnum(0.123456789, 9) = 1.234567890e-01
98- formatnum(123456789.0, 9) = 1.234567890e+08
99- formatnum(123456789.0, 2) = 1.23e+08
100- formatnum(123.456789, 12) = 1.234567890000e+02
101- formatnum(123.456789, 12, False) = 123.456789000000
102- formatnum(123.456789, 3) = 123.457
103- formatnum(3.14159, 4) = 3.1416
104- formatnum(3.14159, 3) = 3.142
105- formatnum(3.14159, 2) = 3.14
106- formatnum(3.14159, 2, True) = 3.14e+00
107- formatnum(3.141592653589793238462643383279502884197169399375105820974944 , 3) = 3.142
96+ formatnum(0.123456789, 4) -> 0.1235
97+ formatnum(0.123456789, 9) -> 1.234567890e-01
98+ formatnum(123456789.0, 9) -> 1.234567890e+08
99+ formatnum(123456789.0, 2) -> 1.23e+08
100+ formatnum(123.456789, 12) -> 1.234567890000e+02
101+ formatnum(123.456789, 12, False) -> 123.456789000000
102+ formatnum(123.456789, 3) -> 123.457
103+ formatnum(3.14159, 4) -> 3.1416
104+ formatnum(3.14159, 3) -> 3.142
105+ formatnum(3.14159, 2) -> 3.14
106+ formatnum(3.14159, 2, True) -> 3.14e+00
107+ formatnum(3.141592653589793238462643 , 3) -> 3.142
108108
109109
110110## Usage
0 commit comments